coop Posted December 27, 2006 Share Posted December 27, 2006 User AuthenticationHi 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. Quote Link to comment Share on other sites More sharing options...
bljepp69 Posted December 27, 2006 Share Posted December 27, 2006 You can't reverse the md5() information. So, I think a good solution in your case is to frist validate which user forgot their password and then send them to a 'change password' page. Since you already have their email address, you can simply send them an email with a link to the change password page. The link can contain some encoded information about the user so you can verify it's them returning. Then, they change their password and move on. Quote Link to comment Share on other sites More sharing options...
timmah1 Posted December 27, 2006 Share Posted December 27, 2006 From my experience, md5 password's can't be sent as plain text.The best thing to do is to reset the password. If they forget the password, email them a link, once they click on the link, it will direct them to a page where they can re-enter a new password, and that will update the database with the new password.That's the only way that I know how to do it. Quote Link to comment Share on other sites More sharing options...
timmah1 Posted December 27, 2006 Share Posted December 27, 2006 Beat me to it!!! 8) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.