I created a very simple login system.It works well when I manually login.Now, I am writing a python program to login to my system using POST request but it's not working.
Below is the python code that I'm working on.When I run this program,it somehow can't get authenticated and shows the source page content of the login page itself.My expectation is to see the source page content of the logged-in user (in this case,admin).
import requests
url = "http://127.0.0.1/userregistration/login.php"
info = {'user': 'admin', 'password': 'password', 'Submit': 'submit'}
response = requests.post(url, data=info)
print(response.text)
this is the source code for my login system.
<html>
<form action='validation.php' method='post'>
<fieldset>
<legend>Login</legend>
<label>UserName</label>
<input type='text' name='user'>
<label>Password</label>
<input type='password' name='password'>
<input type='submit' name='Submit' value='Login' >
</fieldset>
</form>
</html>
Can you please give me some advice ? Thanks!!