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>Rateagam e.net: Forgot Password</title>
<link rel=stylesheet type=text/css href=/rateagame.css>
</head>
<body bgcolor="#00000 0" topmargin="0" leftmargin="0" marginheight="0 "
marginwidth="0" >
<p align="center">
<?
virtual("includ es/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_q uery($query);
$returned=mysql _num_rows($resu lt);
if ($returned>0) {
while($row=mysq l_fetch_array($ result)) {
$data=$row["UserPasswo rd"];
$td = mcrypt_module_o pen (MCRYPT_TripleD ES, "",
MCRYPT_MODE_ECB ,"");
$iv = mcrypt_create_i v (mcrypt_enc_get _iv_size ($td), MCRYPT_RAND);
$dectext = trim(mcrypt_ecb
(MCRYPT_TripleD ES,(Keysize),he x2bin($data), MCRYPT_DECRYPT, $iv));
$user_name = $row["UserName"];
$message = "Hello $user_name!\n\n Your password is:
$dectext\n\nReg ards,\n\nThe Rateagame.net Team\nwebmaster @rateagame.net" ;
mail($row["UserEmail"], "Your Rateagame.net Password", $message, "From:
webmaster@ratea game.net");
$output_message = FormatText("You r password was sent to $email");
echo $output_message ;
}
} else {
$output_message = FormatText("Ema il Not Found");
echo $output_message ;
}
} else {
$output_message = FormatText("Ema il is Blank");
echo $output_message ;
}
function hex2bin($data) {
$len = strlen($data);
return pack("H" . $len, $data);
}
function FormatText($tex t) {
$output_text = "<p align='center'> <b><font face='Trebuchet MS' size='2'
color='#6A6AFF' >$text</font></b></p>";
return $output_text;
}
?>
</body>
</html>
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>Rateagam e.net: Forgot Password</title>
<link rel=stylesheet type=text/css href=/rateagame.css>
</head>
<body bgcolor="#00000 0" topmargin="0" leftmargin="0" marginheight="0 "
marginwidth="0" >
<p align="center">
<?
virtual("includ es/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_q uery($query);
$returned=mysql _num_rows($resu lt);
if ($returned>0) {
while($row=mysq l_fetch_array($ result)) {
$data=$row["UserPasswo rd"];
$td = mcrypt_module_o pen (MCRYPT_TripleD ES, "",
MCRYPT_MODE_ECB ,"");
$iv = mcrypt_create_i v (mcrypt_enc_get _iv_size ($td), MCRYPT_RAND);
$dectext = trim(mcrypt_ecb
(MCRYPT_TripleD ES,(Keysize),he x2bin($data), MCRYPT_DECRYPT, $iv));
$user_name = $row["UserName"];
$message = "Hello $user_name!\n\n Your password is:
$dectext\n\nReg ards,\n\nThe Rateagame.net Team\nwebmaster @rateagame.net" ;
mail($row["UserEmail"], "Your Rateagame.net Password", $message, "From:
webmaster@ratea game.net");
$output_message = FormatText("You r password was sent to $email");
echo $output_message ;
}
} else {
$output_message = FormatText("Ema il Not Found");
echo $output_message ;
}
} else {
$output_message = FormatText("Ema il is Blank");
echo $output_message ;
}
function hex2bin($data) {
$len = strlen($data);
return pack("H" . $len, $data);
}
function FormatText($tex t) {
$output_text = "<p align='center'> <b><font face='Trebuchet MS' size='2'
color='#6A6AFF' >$text</font></b></p>";
return $output_text;
}
?>
</body>
</html>
Comment