Sunday, 19 July 2009

Making forgot password page

Firstly, a form, which is created in "forgotPassword.php" file, has an action interracting with "sendPassword.php" file.



the form in Firefox Browser looks like:



In "sendPassword.php" file, I made a connection path



Extracting values from "forgotpassword.php" file



Check if username exist in the database



generate a random password



Update the random password with the old password



Putting my email in header mail and setting up a mail body



Testing my function in Browser:

a form in forgotPassword.php



Validation Checking



After checking, I go back to the form and input "thientanchuong" in the textfield
then I get a confirmed message:




Finally I check the sent password in my email



However, the password is shown in encrypte format, not in normal way. I need to change a line of code which is.



I replaced a variable $upassword with $password. Afterward, I try to send a new password to my email again.



This time is worked.

No comments:

Post a Comment