The user logon interface written in thinkphp, but every time the user name or password is incorrect, how can this problem be solved?
Query ("select * from developers where username = ". $ POST ['username']. "and password = ". $ _ POST ['password']. ""); if ($ select) {$ _ SESSION ['admin'] =$ _ POST ['username']; $ this-> redirect ('index/Index ', '', 2, 'user '. $ _ POST ['username']. 'logon successful! ');} Else {$ this-> redirect ('index/Index', '', 2, 'incorrect username or password ');}} else {$ this-> redirect ('index/Index', '', 2, 'user name or password cannot be blank! ') ;}$ This-> display () ;}}?>
If you do not enter the correct user name or password, the system prompts that the user name or password is incorrect.
Reply to discussion (solution)
Tp has its own form verification method. why not?
If you still need to write the basic code in the framework, what should you do with the framework?
Only the logic prompt will prompt you that the password is incorrect. can't you find the reason.
Either the post data is faulty or the SQL is faulty. print the post data and check the SQL statement.