User Login interface written with thinkphp, but each time said the user name or password is not correct, solve?

Source: Internet
Author: User
 
  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 ']. ' Login Successful! ');                 } else{$this->redirect (' Index/index ', ' ', 2, ' username or password incorrect ');}} else{    $this->redirect (' Index/index ', ', 2, ' username or password cannot be empty! ');}} $this->display ();}}? >

I do not fill in the prompt my user name or password is incorrect, I fill in the correct also prompt me user name or password is not correct, do not know which problem, ask for answers.


Reply to discussion (solution)

TP has its own form verification method, why not?
If you still need to write your own base code in the framework, what do you do with frames?

Only logical hints will cause you to be prompted with an incorrect password. There's no reason for that.
Either there is a problem with the post data, or there is a problem with the SQL. Print out post data and SQL statements to see.

  • 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.