Will u look at what is wrong with this! I asked u about the mail function yesterday, I keep getting bad printed to the screen
<?php
if($submit)
{
$db = mysql_connect("localhost", "d99kg", "password");
mysql_select_db("d99kg",$db);
$dbQuery="SELECT * FROM users where username='$theusername'";
$result = mysql_query($dbQuery,$db);
$userInfo=mysql_fetch_array($result);
$username=$userInfo["username"];
$password=$userInfo["password"];
$userFunctions=$userInfo["userFunctions"];
$firstName=$userInfo["firstName"];
$lastName=$userInfo["lastName"];
$emailAddress=$userInfo["emailAddress"];
$mailsubject = "Your password";
$mailbody = "Your Password is $password";
//if(mail($emailAddress, $mailsubject, $mailbody))
//{ echo "XXX good";
//}
$myname = "gk";
$myemail = "gk@hotmail.com";
$message = "Your password is $password - Don't forget it again!";
$subject = "Your Password";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers .= "From: ".$myname." <".$myemail.">\r\n";
$headers .= "To: ".$firstName.$lastName." <".$firstName.$lastName.">\r\n";
$headers .= "Reply-To: ".$myname." <$myreplyemail>\r\n";
$headers .= "X-Priority: 1\r\n";
$headers .= "X-MSMail-Priority: High\r\n";
$headers .= "X-Mailer: Just My Server";
if (mail($emailAddress, $subject, $message, $headers))
{
echo "Good";
}
else echo "Bad";
}
?>
Cheers