Lost Password Recovery

Started on the old forum in January 2008 · view the original in the archive · old links redirect here

8 replies · 606 views · started 18 years ago · 1 min read

4 participants
darkdesire Senior · 250 posts #1

does anyone know of any coding that can automatically recover passwords for the sp/youngson script by entering the email addy used to register

:p:p:p

mcKeny Developer · 130 posts #2

on my site whenever the user register they get a welcome message via email.. whenever they select lost pass they enter there user name and email address. .. then check if user name correspond with with the email

$sql = mysql_fetch_array(mysql_query("SELECT nick FROM mc_users WHERE nick='".$nick."' And email='".$email."'"));
if($sql[0]==0)
{
echo "user name didn't match email";
}
else
 {
//get pass from db
$sql = mysql_fetch_array(mysql_query("SELECT pass,email FROM mc_users WHERE id='".callnid_nick($nick)."'"));

if($sql)
{
echo email_form($sql[0],$sql[1]);
}
else
{
echo "DB ERROR".mysql_error();
}
}

assuming you know how to set up a email form..

R.M.C

PHP Adovocate B)

WhiteWarrior Principal · 1,419 posts #3

on my site whenever the user register they get a welcome message via email.. whenever they select lost pass they enter there user name and email address. .. then check if user name correspond with with the email

$sql = mysql_fetch_array(mysql_query("SELECT nick FROM mc_users WHERE nick='".$nick."' And email='".$email."'"));
 if($sql[0]==0)
 {
 echo "user name didn't match email";
 }
 else
  {
 //get pass from db
 $sql = mysql_fetch_array(mysql_query("SELECT pass,email FROM mc_users WHERE id='".callnid_nick($nick)."'"));
 
 if($sql)
 {
 echo email_form($sql[0],$sql[1]);
 }
 else
 {
 echo "DB ERROR".mysql_error();
 }
 }

assuming you know how to set up a email form..

when i first created one like that it used to send the md5 password

Guest #4

I don't know this script but yes - if its uses md5 to encrypt passwords, then offcorse it will send the md5ed password , and the its useless, so its not possible to make password recovery if they are md5'ed, BUT you can make an password RESET system, its simple, if user lost hes password , he just go to password recovery and input hes nick and e-mail, then when press submit, he gets an e-mail with link where he can reset (make new one) password .... Just make an table in mysql when for each password request script makes an session, and put that session to that reset link so script resets correct user ... Think you understood me External image (may be gone)

mcKeny Developer · 130 posts #6

well do you think encrypting the user pass make sense.....

if you got index.php?user=mc_keny&pass=blabla well it would of make sense..

i only encrypt the session/time id on my site

{ echo signin_form(four); 

} else 

{ mysql_query("UPDATE 
mc_users SET 
xtime='".$extime."' WHERE 
nick='".$sinnick."'"); 

$xtime = 
mysql_fetch_array(my 
sql_query("SELECT xtime 
FROM mc_users WHERE 
nick='".$sinnick."'")); 

//use the time to get a 
different time id each 
time they login 

$time = time(); 

$xt = ($time+ $xtime[0 
]*60); 

$tid = 
md5($sinnick.$time); 

$insert = 
mysql_query("UPDATE 
mc_users SET 
extime='".$xt."', 
tid='".$tid."', 
lvis='".date("H:i a")."' 
WHERE 
nick='".$sinnick."'"); 

if(!$insert) 

{echo mysql_error(); 

} else{ 

echo align(center);

R.M.C

PHP Adovocate B)

Guest #7

So, what you want do do ? or what you don't know ?? How to set up an e-mail form ? you just in first post said that you have an e-mail system (when user registers he gets an e-mail) , so whats the problem ? just modified and use that e-mail system to password recovery, principle is the same .... - that if you want to set up an e-mail system to you password recovery ... Its hard to understand what really you want External image (may be gone)

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close