PHP

Forget password script in php

Forget password script in php

Hi In this tutorial we are going to see how to reset the forget password using php code.
The Logic I follows to reset forget password is :

1. Enter username or email.
2. If username or email exist it will send a mail to certain user with password reset form link.
3. Else return with no records found.
4. By clicking reset password link user can update new password.

My Database Name : 17educations_demo

My Table name : members

Step 1 :

Create Database with name of 17educations_demo

Step 2 :

Create members table and insert one static record for demo use.

Step 3 :

Create Password reset request form

index.php

Here I will check wheather user details exists. If exists I have included forgot-password-recovery-mail.php page which contains the code to send mail to the user.

Step 4 :

forgot-password-recovery-mail.php

IF you don’t habe class.phpmailer.php and class.smtp.php please download latest file from here
https://github.com/PHPMailer/PHPMailer/blob/master/class.phpmailer.php



Step 5 :

mail_configuration.php 

Step 6 :

Password Reset form

Here you can enter new password it will store in the members table based on username or email.

If you like this article don’t forget to share and comment.
Thanks!.
Happy Coding!..