...

View Full Version : Variable not getting into email properly



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' ) ;




;}
?>

oesxyl
03-16-2008, 12:17 AM
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!



$row['Password'] = $MailPassword;

$message = "Your password is '.$MailPassword.' ";


echo the $MailPassword to see if is not empty and modify the code:


$message = "Your password is '".$MailPassword."' ";
?>



<?php
$MailPassword = $row['Password'];

?>
best regards

Red Leader
03-16-2008, 11:00 AM
<?php
$MailPassword = $row['Password'];

?>


Hillary be praised.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum