title: Why does my Python POST request lead me to the initial webpage?
body: <p>I am new to this Forum and relatively new to coding</p>
  <p>This question has already been asked here but the solutions didn't seem to work for me.</p>
  <p>I'd like to log into the index.php page using a Python Post request, but the response url remains the same with the intitial login page indicating that the login was not successful.</p>
  <pre><code>import requests as r
  
  login_url = &quot;https://www.example.com/index.php?login&quot;
  index_url = &quot;https://www.example.com/gymla/index.php&quot; #The url I want to be directed to
  
  data = {
      &quot;isiwebuserid&quot;: &quot;username&quot;,
      &quot;isiwebpasswd&quot;: &quot;password&quot;,
      &quot;submit&quot;: &quot;Senden&quot;
  }
  
  s = r.session()
  response = s.post(login_url, data=data)
  
  print(response.url)
  if response.url == login_url:
      print(&quot;The attempt did not work.&quot;)
  </code></pre>
  <p>I've checked with &lt;form action if the login URL might be wrong, but it seems alright. The form data is also complete. What else could be wrong?</p>