PHP Change Password script using mysql
Change password feature is a common requirement for any membership management script. Here members can change their password after logging in to the member area. Here we will check the session of the member to allow or disallow the access the change password page of the site. Here we can ask the member to enter the old password once and then enter new password twice.
This is a basic script and we can create a change password script by using Ajax ( with PHP MySQL) and update the new passwords. Our new membership management script uses this and there is a demo available to check the functionality.
Demo of Change Password script using Ajax
We know the user-id if the member as he has logged in so we will not ask the member to enter userid again. It is not a good practice to allow the member change his or her userid.
The new password will be effective from the next login of the member.
We will ask the member to enter the new password twice. Both the entered password should match and must pass the validation. If all the checks passed well then we will update the record of the member with new password.
Let us start with the form. You can download the code at the end of this tutorial but here is the form for change password.
Learn the script part to handle user inputs for changing the password >>
Number of User Comments : 7