webguync Posted December 9, 2010 Share Posted December 9, 2010 I've never actually done a username password, retrieval script before so need a little help. In the profile form the user is submitting username/password/name/email etc. into a MySQL DB along with a security question and answer. Is it just a matter of creating a form which does a check against the database and sends out an email to the user with their password? The password is hashed with MD5, so how would I send out an un-hashed PW? thanks! Quote Link to comment https://forums.phpfreaks.com/topic/221136-lost-usernamepassword-script/ Share on other sites More sharing options...
AbraCadaver Posted December 9, 2010 Share Posted December 9, 2010 I've never actually done a username password, retrieval script before so need a little help. In the profile form the user is submitting username/password/name/email etc. into a MySQL DB along with a security question and answer. Is it just a matter of creating a form which does a check against the database and sends out an email to the user with their password? The password is hashed with MD5, so how would I send out an un-hashed PW? thanks! Hashing is one-way so you can't unhash it. You would need to generate a new password, update the db and then send them the new password. Quote Link to comment https://forums.phpfreaks.com/topic/221136-lost-usernamepassword-script/#findComment-1145006 Share on other sites More sharing options...
webguync Posted December 9, 2010 Author Share Posted December 9, 2010 thanks, can you give me an idea of how to do this. Never done it before (obviously). Quote Link to comment https://forums.phpfreaks.com/topic/221136-lost-usernamepassword-script/#findComment-1145007 Share on other sites More sharing options...
Maq Posted December 9, 2010 Share Posted December 9, 2010 thanks, can you give me an idea of how to do this. Never done it before (obviously). Just Google "php lost password", there are plenty of examples. Quote Link to comment https://forums.phpfreaks.com/topic/221136-lost-usernamepassword-script/#findComment-1145009 Share on other sites More sharing options...
AbraCadaver Posted December 9, 2010 Share Posted December 9, 2010 Present a form that asks for the username or email, and when submitted, query the database for the security questions. Present a form with the security questions, and when submitted, query the db for the answers for the specific user. If they match then generate some random password, md5 it and update the db. Then just send them the newly generated (not md5) password. Quote Link to comment https://forums.phpfreaks.com/topic/221136-lost-usernamepassword-script/#findComment-1145011 Share on other sites More sharing options...
webguync Posted December 9, 2010 Author Share Posted December 9, 2010 ok thanks. Looks like Google is s bit help so I will check out those scripts and post if I encounter any problems. Quote Link to comment https://forums.phpfreaks.com/topic/221136-lost-usernamepassword-script/#findComment-1145060 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.