# Best technique for password reset

**URL:** <https://forum.kirupa.com/t/best-technique-for-password-reset/283835>\
**Category:** programming\
**Created:** [March 11, 2009, 4:46pm UTC](https://forum.kirupa.com/t/best-technique-for-password-reset/283835 "2009-03-11T16:46:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Brucelines](https://avatars.discourse-cdn.com/v4/letter/b/da6949/32.png) [@Brucelines](https://forum.kirupa.com/u/Brucelines)\
**Post date:** [March 11, 2009, 4:46pm UTC](https://forum.kirupa.com/t/best-technique-for-password-reset/283835/1 "2009-03-11T16:46:36Z")

</div>

Hi,

I’m currently building a php & mysql driven site which has a membership section to.

As the title suggests, what is the best technique to reset a member’s password if they’ve forgotten it?

What I’m about to do is make the user fill in a “forgotten password” form with either the username or username and email address. When they submit, their password will be cleared and I will generate a random temporary password for them. Then an email will be sent to the member with the new password for them to login.

Another way I was thinking was for the user to fill in a “fogotten password” form with only the username and the original password will be sent to the registered email address. So then nothing changes.

Are there other techniques I should be considering? I haven’t a clue when it comes to security and I’m an absolute beginner with php and mysql.

Thanks
