The user logon interface written in thinkphp, but every time the user name or password is incorrect, how can this problem be solved?

Source: Internet
Author: User
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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.