On the php login page, the account password is clearly correct, but the error is always displayed. please take a look. thank you!

Source: Internet
Author: User
$ _ Loginarray (); if (isset ($ _ POST [& #39; submit & #39;]) {$ _ login [& #39; username & #39;] _ check_username ($ _ POST [& #39; zh & #39;], 2, 20); $ _ login [& #39; password & #39;] _ check_password ($ _ POST [& #39; mm & #39;], 6, 18); if (_ fetch_array (& quot; SELECT * FROMuserinforWHERE php

$ _ Login = array ();
If (isset ($ _ POST ['submit ']) {
$ _ Login ['username'] = _ check_username ($ _ POST ['zh '], 2, 20 );
$ _ Login ['password'] = _ check_password ($ _ POST ['mm'], 6, 18 );
If (_ fetch_array ("SELECT * FROM userinfor WHERE username = '{$ _ login ['username']}' and password = '{$ _ login ['password']}' ")) {
Header ("Location: index. php ");
} Else {
Echo "incorrect user name or password ";
}
}

Two functions
Function _ query ($ _ SQL ){
If (! $ Result = mysql_query ($ _ SQL )){
Exit ('SQL execution failed ');
}
Return $ result;
}
Function _ fetch_array ($ _ SQL ){
Return mysql_fetch_array (_ query ($ _ SQL), MYSQL_ASSOC );
}

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.