Correct password PHP

Source: Internet
Author: User
PHP & lt ;? Php & nbsp; session_start (); & nbsp; header ("Content-type: text/html; & nbsp; charset = utf-8"); & nbsp; include & nbsp; '.. /config. php 'change password PHP
 Session_start ();
Header ("Content-type: text/html; charset = utf-8 ");
Include '../config. php ';
If ($ _ SESSION ['admin'] = '') header ('Location: index. php ');
$ Show = "display: none ;";
$ SQL = "SELECT * FROM 'CP _ admin' WHERE 'id' = '1 '";
$ Ret = mysql_query ($ SQL );
$ Row = mysql_fetch_assoc ($ ret );
 
If ($ _ POST ){
$ Admin = $ _ POST ['admin'];
$ Pass = $ _ POST ['pass'];
$ Pass1 = $ _ POST ['pass1'];
$ Pass2 = $ _ POST ['pass2'];

If ($ row ['name']! = $ Admin & $ row ['pwd']! = Md5 ($ pass) & $ pass1! = $ Pass2 ){
Echo "script alert ('modification failed because the original password is incorrect, or the passwords entered twice are different! ') Script ";
} Else {
$ Pass1 = md5 ($ pass1 );
$ Sql1 = "UPDATE 'CP _ admin' SET 'name' = '{$ admin}', 'pwd' = '$ pwd2 ). ', WHERE 'id' = '1 '";
Mysql_query ($ sql1 );
Echo "script" alert ('modification successful! ') Script ";

Echo" Location. href = 'exit. php'; script ";
$ Show = "display: block ;";

}
}
?>
What's wrong with this.
------ Solution --------------------
This post was last edited by xuzuning at 10:16:01 on, "UPDATE 'CP _ admin' SET 'name' = '{$ admin}', 'pwd' = '$ pwd2 ). ', WHERE 'id' = '1 '"
?????????
------ Solution --------------------
It is better to post your error message

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.