php - Help on how to let a user change his password after authentication -


When a user forgets their password, reset their password to reset their email account with a link and token (unique) The password is sent .php

When authentication is correct, it is able to change the password. My question is how can this happen? In a quick and easy way, he has to email a new password and change it through his CPU, but is this a good user experience?

  $ result = mysql_query ("Forgot member WHERE select member number = '$ token'"); If (mysql_num_rows ($ result) == 1) {What happens here? } And (die ("question failed");}    

what's happening here ?

Something like this

  echo 'Your password was sent to you'; Mysql_query ("Update Member Set Password = '". $ Random_hashed_string. "' WHERE Forgotpass = '$ token' "); mail ($ $, $ theme, $ message." Password: ". $ Random_hashed_string," from: support@support.com ");    

Comments

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

memcached - Django cache performance -