PDA

View Full Version : mysql/php help


Reecey
02-19-2008, 06:38 PM
Right i have had a custom usersystem made but its really bugging me by the fact user's have to ask for thier password to be reset if they forget it so could anyone help me with the mysql/php page that i will need like if someone could post the mysql/php code and tell me which bits to edit i will give REP.

Thanks

--------------- Added 1203455243 at 1203455243 ---------------

Anyone Please Help ???

Eikinskjaldi
02-19-2008, 08:38 PM
You have not explained exactly what you want done.

Reecey
02-20-2008, 10:02 AM
Right basically i need a php/mysql page making that will call a database table and allow the user to edit that value e.g. a change password page.

Opserty
02-20-2008, 10:18 AM
There are hundreds upon thousands of PHP & MySQL tutorials out there, do a bit of searching!

No-one is going to give you all the code. Break down your solution to begin with and then look up how you need to each part...

E.g. Password Recovery:

Generate a temporary random hash for the password recovery, store it in the database along with the time it was made. (The hash can be a md5() of the time and some random number, for example)
Send a link to the page in an email to the email of user's account, (the link should include the hash in the url e.g. restpw.php?hash=....)
On resetpw.php check there is a hash, if yes, then verify that the hash hasn't expired (like say after 1 day the hash is no longer valid (this is a timestamp comparison))
If the hash is valid then provide them with a form to edit & confirm the new password
Store the new password in the DB.
Optional: Send an email to the user that the password has been reset