I have posted this question in other forum too.
Anyways, my question is this, I generated password for my users using PASSWORD (), now i have a forgot password page where users can input their email to have a new password sending to them. I have the UPDATE part done successfully for the script. However, when users receive email they can only see their new password, but their username is blank.
here is the script,..
Code: Select all
$newpass = substr(md5(time()),0,6);
$sql = "UPDATE mgrs SET mgrpass = PASSWORD('$newpass') WHERE mgremail='$email'";
mysql_query($sql);
$sql = mysql_query("SELECT * FROM mgrs WHERE mgremail='$email'",$link);
while ($a_row =mysql_fetch_array ($sql) )
{
$subject = "Your Login and Password";
$fromName = $yourname;
$fromAddres = $youremail;
$message = "Your login name is: $rowїmgr]\r\nYour password is: $newpass\r\n";
$temp = mail($email, $subject, $message, "From: ".$fromName." <".$fromAddress.">") or print "Could not send mail.<BR><BR><P>";
if ($temp = true) {print "Check your email for username and new password<P> ";}
}Code: Select all
Your login name is :
Your password is : 6063adthanks a bunch.