chornbeck
03-15-2008, 08:23 PM
Everything here works fine, except the message that says "Your Password Is..." in the email - the variable is not making it into the email - what is wrong with my $message variable? Thanks!
$sqlquery="SELECT * FROM table WHERE EmailAddress='$ForgotEmail'";
$results= mssql_query($sqlquery);
$row = mssql_fetch_array($results);
$row['Password'] = $MailPassword;
$num_rows = mssql_num_rows($results);
if ($num_rows > 0) {
$to = $ForgotEmail;
$subject = "Your Owner Account";
$message = "Your password is '.$MailPassword.' ";
$from = "owneraccounts@mysite.com";
$headers = "From: $from";
mail($to,$subject,$message,$headers);
echo "Your password has been emailed to you!";
} else {
header( 'Location: http://www.mysite.com/os_email_not_found.php' ) ;
;}
?>
$sqlquery="SELECT * FROM table WHERE EmailAddress='$ForgotEmail'";
$results= mssql_query($sqlquery);
$row = mssql_fetch_array($results);
$row['Password'] = $MailPassword;
$num_rows = mssql_num_rows($results);
if ($num_rows > 0) {
$to = $ForgotEmail;
$subject = "Your Owner Account";
$message = "Your password is '.$MailPassword.' ";
$from = "owneraccounts@mysite.com";
$headers = "From: $from";
mail($to,$subject,$message,$headers);
echo "Your password has been emailed to you!";
} else {
header( 'Location: http://www.mysite.com/os_email_not_found.php' ) ;
;}
?>