I was wondering if someone could explain why I'm receiving this error. It's
like a 404 error but I think it might be something else.
Basically, I have a page where a user inputs his email address. The system
is supposed to look up the email address and send the associated password to
that email address. It worked up until a few months ago. Note that the
validation works. So, if the user tries to submit a blank text box, it
returns an error. If the email address is not found, it returns an error
"Email not found." But if the email is valid, it just dies. This code
worked a few months ago when I initially wrote it.
Thanks for any help.
<html>
<head>
<title>Rateagame.net: Forgot Password</title>
<link rel=stylesheet type=text/css href=/rateagame.css>
</head>
<body bgcolor="#000000" topmargin="0" leftmargin="0" marginheight="0"
marginwidth="0">
<p align="center">
<?
virtual("includes/header.inc");
$email=$_POST['strEmail'];
if ($email != "") {
$dbh = mysql_pconnect("*","*","*");
mysql_select_db("mja674s",$dbh);
$query="SELECT UserName, UserPassword, UserEmail FROM Users Where UserEmail
= '$email'";
$result=mysql_query($query);
$returned=mysql_num_rows($result);
if ($returned>0) {
while($row=mysql_fetch_array($result)) {
$data=$row["UserPassword"];
$td = mcrypt_module_open (MCRYPT_TripleDES, "",
MCRYPT_MODE_ECB,"");
$iv = mcrypt_create_iv (mcrypt_enc_get_iv_size ($td), MCRYPT_RAND);
$dectext = trim(mcrypt_ecb
(MCRYPT_TripleDES,(Keysize),hex2bin($data), MCRYPT_DECRYPT,$iv));
$user_name = $row["UserName"];
$message = "Hello $user_name!\n\nYour password is:
$dectext\n\nRegards,\n\nThe Rateagame.net Team\nw********@rateagame.net";
mail($row["UserEmail"], "Your Rateagame.net Password", $message, "From:
we*******@rateagame.net");
$output_message = FormatText("Your password was sent to $email");
echo $output_message;
}
} else {
$output_message = FormatText("Email Not Found");
echo $output_message;
}
} else {
$output_message = FormatText("Email is Blank");
echo $output_message;
}
function hex2bin($data) {
$len = strlen($data);
return pack("H" . $len, $data);
}
function FormatText($text) {
$output_text = "<p align='center'><b><font face='Trebuchet MS' size='2'
color='#6A6AFF'>$text</font></b></p>";
return $output_text;
}
?>
</body>
</html>