PHP sending forgotten password
Posted: Thu Feb 05, 2009 6:39 am
Hello
I need to modify this code for users who have forgotten their password.
the problem is if one user have more profiles with same email - then this script can’t send the user name and pass.
Example
user name : brian
email: myid@test.com
user name: hans
email: myid@test.com
maybe a loop .?
<?
$Query = mysql_query("select * from profiler where email = '$_POST[mail]'");
$Number = mysql_num_rows($Query);
if($Number == 1) {
$row = mysql_fetch_array($Query);
mail("$_POST[mail]","Genudsendelse af kodeord","Hej,
Your username is: $row[brugernavn]
Your password is...: $row[kodeord]
You are now ready to log on to http://www.xxx.dk
All the best
xxx.dk");
} else {
echo '<p><strong>We could not find your profile with this e-mail adresse ('.$_POST[mail].') </p>';
}
?>
I need to modify this code for users who have forgotten their password.
the problem is if one user have more profiles with same email - then this script can’t send the user name and pass.
Example
user name : brian
email: myid@test.com
user name: hans
email: myid@test.com
maybe a loop .?
<?
$Query = mysql_query("select * from profiler where email = '$_POST[mail]'");
$Number = mysql_num_rows($Query);
if($Number == 1) {
$row = mysql_fetch_array($Query);
mail("$_POST[mail]","Genudsendelse af kodeord","Hej,
Your username is: $row[brugernavn]
Your password is...: $row[kodeord]
You are now ready to log on to http://www.xxx.dk
All the best
xxx.dk");
} else {
echo '<p><strong>We could not find your profile with this e-mail adresse ('.$_POST[mail].') </p>';
}
?>