How to implement the administrator password modification function
First find thepass.htmlpage in theadmindocument and modify it to thepass.phpfile.
Then change the text "Change Member Password" to "Change Administrator Password".
After the modification, the following effect will be obtained:
After the modification is completed. The function can be realized. Let’s talk about the implementation process:
Use the database SQL statement to query whether the original password entered matches the password filled in the text box
If it matches, then If successful, the SQL statement modification function will be used to modify the password in the database
After the modification is successful, return to the login page and log in again with the new password.
The code is as follows:
alert('原始密码不正确,请重新输入');"; } else{ if ($newpassword==$confirm) { $sql2 = 'update admin set password ="'.$newpassword.'" where id =1'; mysqli_query($link,$sql2); echo ""; } } } ?>