I know I’m missing something here. I’ve been staring at this short script for a while now and I can’t see where it’s going wrong.
Here’s my script:
And here’s the script in action:
http://troop007.tk/login.007?action=login
The username and password are both “demo”. I type in the username and password, press log in, and instead of taking me to login.007?action=logincheck, it never leaves login.007?action=login.
I have one MySQL table called users, and inside that table there are two fields: username and password.
The script I’m using is a modified version of the script found here: http://www.phpeasystep.com/phptu/6.html
I would scrap that tutorial, login security is not tobe looked upon lightly, you should not have plaintext passwords in the database they should be hashed with a salt and both should change upon successful login.
Here is A secure login script:
It uses PDO for the database connection, the actual login form uses random keys for login eg. not username/password. Passwords are hashed with sha512 x 25k times and with a 16byte key salt, brute force protection. Hope it helps.