Hi everyone.
The script below is used to send login information to the user if the forget thier login.
One Problem... I will not send the email. I now the email portion works because I use it many other places on the site.
The problem I think is they where I have the row definition placed.
$pass= $r["pass"];
$email = $r["email"];
$memberid= $r["memberid"];
I do not think it is able to pull the email address this way. Do I have these in the wrong place? If the script reaches this porton of the code I have:
echo "Email should be sent"; I get this everytime I enter a correct memberid. So I know it is trying to send the email.
...................................................................................................................
<?
$db_name = "xxxx";
$table_name = "xxx";
$connection = @mysql_connect("localhost", "xxxxx", "xxxxxx")
or die("Couldn't connect.");
$db = mysql_select_db($db_name, $connection)
or die("Couldn't select database.");
$sql = "SELECT * FROM $table_name
WHERE memberid = '$memberid'";
$result = mysql_query($sql)
or die ("Can't execute query.");
$num = mysql_numrows($result);
$pass= $r["pass"];
$email = $r["email"];
$memberid= $r["memberid"];
if ($memberid=="")
echo "<font face='Verdana, Arial, Helvetica, sans-serif' size=2>You must enter your Member ID. </font> ";
else
if ($num != 0) {
echo "Email should be sent";
$msg = "Your login is below. Please keep it in a safe place.\n";
$msg .= "Password: $pass\n";
$msg .= "\n";
$msg .= "This is the message. $message\n\n";
$to = "$email";
$subject = "Your login information!";
$mailheaders = "From: phpcodefinder.com <> \n";
$mailheaders .= "Reply-To: $email\n\n";
mail($to, $subject, $msg, $mailheaders);
} else {
echo "<font face='Verdana, Arial, Helvetica, sans-serif' size=2>";
echo "Your Member ID could not be located.</font><br>";
}
?>