I am working with forget password in php with my sql,if a user has forget his name ,he can write his name and email id and password is sent to his mail id....how i can do this???? I am working on online PHP web application.

MartinPlatt
—
2011-09-12T07:05:19Z —
#2

I would expect that you would store the users' e-mail address when they register.

If they request a password reset, you send them an e-mail to confirm this.Then you create a new random password, and e-mail that to them.

I'm sure that there would be PHP code for free if you Google it.

vazqjose
—
2011-09-12T18:07:50Z —
#3

You can easily get javascript code to for the email format check. BUT you will also need php code as well to check if the email address actually works. Be sure you get that when you get to Google

Dumler
—
2011-09-12T19:15:35Z —
#4

Quoting to MartinPlatt,

Yeah the basic idea of resetting easily your password is the method where you send user a link (usually which holds user id in the link as a variable) and make a function to reset that user id password and send a new password to his email.

Very easy to script.

gauvion
—
2011-09-12T20:38:02Z —
#5

tamanna said:

I am working with forget password in php with my sql,if a user has forget his name ,he can write his name and email id and password is sent to his mail id....how i can do this???? I am working on online PHP web application.

create a field in your users table called "forgot_pw_hash" that will store a random md5 or encrypted value. when a user clicks on forget password, update the database with this has then email it to them. when they visit a page with the GET variable set to that hash, allow them to change their password.

tamanna
—
2011-09-13T06:02:30Z —
#6

gauvion said:

create a field in your users table called "forgot_pw_hash" that will store a random md5 or encrypted value. when a user clicks on forget password, update the database with this has then email it to them. when they visit a page with the GET variable set to that hash, allow them to change their password.

i have made a login table with username and password in md5 form...so i can't use that login table if a user has forget his password...i will make a forget table but how it will match with login table

i am very confused please help...

tamanna
—
2011-09-13T06:03:49Z —
#7

can you please suggest me a script...

Dumler
—
2011-09-13T16:46:24Z —
#8

I have no clue what you tried to point out there, but here is a script for ya!