I've created a forgot pass page,
a user inputs there email adresss and I set them a new pass and email it to them.
but it says its sent an email even if the email address does nt exist...
<?
mt_srand((double)microtime() * 1000000);
$charlist = "qwertyuiopasdfghjklzxcvbnm1234567890";
$newpass = '';
$max = strlen($charlist) - 1;
for ($i = 0; $i < 10; $i++) {
$randnum = mt_rand(0, $max);
$newpass .= $charlist{$randnum};
}
$newpass2= md5($newpass);
$sql = "UPDATE user SET
password='$newpass2'
WHERE email='$email'";
if ($result = mysql_query($sql)) {
$femail= "junk@actionleague.co.uk";
$temail= $email;
$message="Hi there, as requested please find your new password below:\n\nPassword: $newpass\n\nPlease login and change your pass immediately";
if(mail($temail,":: Password Reminder ::",$message,"From: $femail\n")) {
echo "We have sent an email including your new pass to $email";
} else {
echo "Sorry, there was a problem sending your reminder. Please try again letter or contact an admin.";
}
}
?>
any way to say if the email does nt exist echo no email found and if it is found send as normal..
Thanks