What is the best way to do ‘Reset Password’ functionality in php ?
Two step process.
-
User will enter the email Id, mail will send him to user with the link.
-
When user click the link, he can see tow fields to reset his password.
Can anybody right the script flow for this ?
i hope this will help you. first you have to create a table name “token” with a column of seqid,tokenid,status.. sequence id will represent the sequence number tokenid in a hash form and the status it explain itself.
Now you have to compute a url that is one time used only after the user click the reset password the system will generate a tokenid (its up to you how to generate a hash value)
and then compose a url that will be submitted to the user via email
domain name/function Or Page ? username(in hash form) & tokenid
example:
http://www.yourdomain.com/resetpassword.php?_u=82cc5b9e02d711035aafef9e18c7eb26973e8962&tokenid=82cc5b9e02d711035aafef9e18c7eb26973e8962
after the user click the url it will go to function and check who is the user or if it is existing and the tokenid if it is already expired
and then reset his/her password when its done you need to change the status of the token to “inactive” so it cannot be used again
thanks please rate! goodluck