...

View Full Version : User Authentication



cooper10
12-27-2006, 05:25 PM
User Authentication

Hi all,

Still new to php so I'll try and explain my problem.
I'm trying to produce a User authentication page so a user can log in with a user name and password. I've worked out setting up the database and adding new users to the database. So now people can log into pages using there user_id and password which is checked on the MySQL database.
The problem comes when a user forgets there password and I wanted to send it to the email that they used in the registration. I'm using md5(), so the database contains a 32-character hash, it is possible to transfer this back to plain text.

Any help would be greatly apperciated. I'm usin fFlash for the front end but any help or tutorials would be fine.

c.

eak
12-27-2006, 05:56 PM
you can not get the original text from a hash. you may want to look at encryption instead if you want to retrieve the original password.
MySQL Docs: http://dev.mysql.com/doc/refman/5.0/en/encryption-functions.html

danielwarner
12-27-2006, 05:58 PM
you cant un-encode md5

how i would do it is i would send them a link in an email that went to a page which they could then enter a new password which would over-write the old password. Also add in a few sequrity features like the link in the email has a random 30 character string attached to it which in another table in a database knows that that spacific string is in relation to the users id. Then delete it when the new password is set etc etc...

http://www.totallyphp.co.uk/code/send_email_using_the_php_mail_function.htm



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum