PDA

View Full Version : Forgotten Password Email Responder


karolmcauley
10-14-2002, 10:10 AM
I have got a miny login section for a part of my site and some of those people that have logged in/registered cannot remeber their username or password. I know it is possible to have an email responder for those that have forgotten these details. For instance, on the login screen it will also state:

Forgot Password, Please Click Here.

Upon clicking here the user will be taken to another screen which states to enter email address. upon entering a valid email address then this will connect to the database for this email and pull out the username and password for that email and then send it to them. But i am confused to the coding to use as there are severall parts to this process:

1. validate email address
2. login script to database
3. check database for email address (what if the same one exists twice!!!)
4. pull out username and password for that email address
5. cdonts script to send this information to the retrieved email address.

Any help whatsoever would be appreciated.

beetle
10-14-2002, 03:14 PM
Although this has nothing to do with javascript...here's how I handle that stuff

1. Have user enter email AND username
2. Verify that this is a valid user
3. Create new random password
4. Update DB with new password
5. Email new password to user

I create the new passwords because I store passwords in the DB with a 1-way encryption, so they cannot be retrieved, only validated.

Having the user enter their username keeps things straight if by chance an email is duplicated. Because of the signup/register process I have in place...usernames will NEVER be duplicated.