Please complete user name AND email address. | "; }
else {
$sql = "SELECT * from tableuser WHERE Username = '$loguser' AND Email = '$logmail'";
$result = mysql_query($sql);
if(!mysql_num_rows($result))
{ $Test = "true";
echo "Please check your data. No such user was found in the registry database. |
"; }
if(mysql_num_rows($result))
{ while($row = mysql_fetch_object($result))
{ $ID = $row->User_ID;
$Signatur = $row->Forename." ".$row->Surname; }
function RandPass()
{
$randomPassword = "";
srand((double)microtime()*1000000);
for($i=0;$i<10;$i++)
{
$randnumber = rand(48,120);
while (($randnumber >= 58 && $randnumber <= 64) || ($randnumber >= 91 && $randnumber <= 96))
{
$randnumber = rand(48,120);
}
$randomPassword .= chr($randnumber);
}
return $randomPassword;
}
$string = RandPass();
$string1 = md5($string);
$sql1 = "UPDATE tableuser SET Password = '$string1' WHERE User_ID = '$ID'";
$result1 = mysql_query($sql1);
if($sql1)
{
$msg = "Dear ".$Signatur.".
Your password has been changed successfully. |
Your new password: ".$string."
For security reasons, please change this password once you logged in.
Sincerely,
The DNA Bank Network Team
|
";
$from = "From: contact@dnabank-network.org\n";
$from .= "Content-Type: text/html\n";
mail($logmail, "DNA Bank Network - New Password", $msg, $from);
$Test = "false";
echo "Dear customer. You will immediately receive an email with your new password. |
"; }
}
}
}
if($Test != "false" or $Test == "true")
{
?>