How to maintain the password history using php and mysql

539 0

In this tutorial I will explain how to maintain password history using php and mysql. This means a user who must change their password can’t reuse the password they just had. This tutorial explains how user new Password should not be same as any of the prevoius 3 Passwords.

This tutorial include three pages

  • Index.php
  • Change-password.php
  • Config.php

And includes two tables

  • tblregistration
  • tblpasswordhistory

Structure of table tblregistration

Structure of table tblpasswordhistory

index.php page include registration and login form

Code for Registration-

Code for login

Code for change password

Details for Demo—–

Login Details
Email — anuj@gmail.com
Password– Test@12345
Last two password—  Test@123 and Test@1234

Comments

comments

In this article

Join the Conversation