In forgot password in PHP Change Password Script using mysqli. After the change password successful your form submits, the PHP server side code will access Mysqli database to get or fetch current password from the Database retrived. If this database value is both value matched with the your forms current change password value, then the password will be successfully changed.
Forgot Password Recovery (Reset) using PHP and MySQL
Core Logic
- First step, you have created simple HTML form with respective all the text-filed(old password, new password, Retype password).
- Check the basic validation whether the new password and Retype password is same or not and all empty fields validation.
- After the check javascript validation,and then check serverside you have to check old password (true or false) valid or not. The password is the same or match then allow skip to next level.
- Simple old password type and new password type is same(Both are same) don’t allow the any option change the forgot password.
login signup with forgot password in php
Step 1: mail configuration
mail_configuration.php
Step 2: Create Database Table
students.sql
-- -- Table structure for table `students` -- CREATE TABLE IF NOT EXISTS `students` ( `student_id` int(8) NOT NULL, `student_name` varchar(255) CHARACTER SET utf8 NOT NULL, `student_password` varchar(64) NOT NULL, `student_email` varchar(255) CHARACTER SET utf8 NOT NULL ) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=latin1; -- -- Dumping data for table `students` -- INSERT INTO `students` (`student_id`, `student_name`, `student_password`, `student_email`) VALUES (1, 'vincy', 'e2f3088a505f1ed02e40f5b62550f291', '[email protected]');
Step 3: Forgot Password Source Code
index.php
Step 4: Forgot Password Mail Sending script
forgot-password-recovery-mail.php
" . $student["student_name"] . ",Click this link to recover your password
Regards,
" . PROJECT_HOME . "php-forgot-password-recover-code/reset_password.php?name=" . $student["student_name"] . "
Admin.