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