Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to e-mail forgotton password

Status
Not open for further replies.

buspass

Programmer
Feb 2, 2003
29
GB
I run a site that requires a username and password to perform certain actions. I want to offer users opportunity to have their password emailed to them instantly if they have forgotton it. They will provide data to verify themselves, and the current password retrieved from the db, then i want that password ( or a replacement pwd) emailed to them automatically.

Can php do this? If so can someone tell me how to do it?
 
Hi,

It is possible to do that by using php's mail function, just get the username and password and email from the db, then send an email to the recipient using their email that you pull from the db and then within the email put in a message and then include their username and password.

You could also just have something on your site where after they put in an answer to a secret questiohn just use and update form so that they can update their password right their on your site, just like how hotmail does it.

Hope this helps!
relax.gif

 
2 welcome replies. Thanks a lot.

First offers good idea about secret question, and second directs to a great site that has exactly what I want, only I need to tailor it to suit my needs.
 
Realize and consider what he said about Hotmail though. It allows you to -change- your password at that point, not have it sent to you.

It's generally considered quite a security problem to email people their passwords... I would strongly suggest the option of resetting their passwords for the following reasons.

1) If someone's password is emailed to a malicious person, the actual owner has no way of knowing as much, if it's reset the account may still be compromised, but at least the original owner knows as much.

2) Many people re-use passwords, not even the administrator should really be having access to passwords for this reason.

-Rob
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top