Forgot password mailer not working
Can any one see wha't worng here.
This piece of code should return the users password by email but the email arrives successfully without any password.
The email is sucessfully passed as $_POST['email'] as it is used as the email address for the email sent so something else msut be wrong>
Any ideas?
***********************************
$email = $_POST['email'] ;
$sql = mysql_query("SELECT email, password FROM users where email = '$email'")
or die(mysql_error());
$row = mysql_fetch_array($sql);
$rownum = mysql_num_rows($sql);
$to= $row['email'];
$subject= "Your login details";
if(!$rownum ) {
echo "<H3>Sorry, that email address does not match our records</H3>";
}
if($rownum ==1 ){
$message .= "Your password is:\n\n".$row['password']."\n\n
To sign-in click here http://www.mysite.com/admin/sign-in.php";
$header = "From: support@mysite.com.com";
$sent = mail($to,$subject,$message,$header);
if($sent)
{
print "<H3>Your password has been sent to your e mail address</H3>" ;
}
}
***********************************
