November 25, 2013 8:05 am

How to create forget password recovery procedure in PHP

Few days ago we post and tutorial on login and signup procedure and today I am going to write an other element of that login procedure for PHP Developers which is recover your password using email verification with encrypted key. This article demo is merged with login & signup demo.


Database Details:

database name => phpgang

table name => users


Database file run in your MySQL to create database and add data in table.


Edit this file as per your database credentials.


Contains PHP code, check user, validate email, create encrypted string to reset password with userid and add some numbers to make it unidentified.

Execution if this code send an email (used simple mail() function you can also use SMTP) with a confirmation link which redirect you to reset.php.


Contains PHP code, get encrypted string validate it and show you 2 input password boxes and to enter your new password.

Used jQuery to match re-entered password

This is just explanation of main code to get complete code please download it from here.

If you have any problem regarding this tutorial configuration please feel free to comment we love to answer your queries.

Author Huzoor Bux

I am Huzoor Bux from Karachi (Pakistan). I have been working as a PHP Developer from last 5+ years, and its my passion to learn new things and implement them as a practice. Basically I am a PHP developer but now days exploring more in HTML5, CSS and jQuery libraries.

Tutorial Categories: