Jump to content

to inform user password


ayok

Recommended Posts

Hi,

 

I've got a question about user password. What I mean is that an admin table (for example) which contain passwords for all admins.

I use password('password') statement to insert a password from registered form. So for example, a user has insert a new password "newpassword" it will show in mysql table as *667072648CC4B683F6292F5DB1556.

 

The problem is, how can I view the real password if they forgot their own password?

 

Thank you,

 

ayok

Link to comment
https://forums.phpfreaks.com/topic/105119-to-inform-user-password/
Share on other sites

MySQL PASSWORD() function is one way encryption.

If you did not saved the password in uncoded way in other place or you do not have enough powerful computer and algorithm to break encoded password - you cannot view the real password.

 

Common way in such situation is sending to user a newly generated password by email and allowing him to change it by himself.

 

Usually when user registers he is requested to fill his email address and password (retyping password is to be sure that you typed correct password). Then application sends email to the user with link that activates user account. The same email is used to send a new password if user request for it.

That is typical way.

 

To save email address just add a new column to users table.

The easiest way around that is to send a new randomly generated password to the users email address and force them on first relogin to change their password.  Once they have changed their password re-encrypt and start the process all over. (if they forget thier password again).  Im sure there is a way around it, i use $md5pass, and thats the only way i know how to get around it.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.