Hello:
I have a script which resets a password when a person can't remember theirs.
This script was working fine a few days ago. Now, when I'm running the final tests, the result of this script is a blank page.
Can someone lay a second pair of eyes on this script and maybe see something that I'm missing?
Thank you so much.
<?php
include "conn.inc.php";
switch($_REQUEST['req'])
{
case "recover":
$sql = mysql_query("SELECT * FROM member
WHERE
memberid = '{$_POST['memberid']}' && email = '{$_POST['email']}'
");
if(mysql_num_rows($sql) == 1)
{
while($row = mysql_fetch_assoc($sql))
{
$alphanum = "abchefghjkmnpqrstuvwxyz0123456789";
for ($i=0; $i <= 10; $i++) {
$num = rand() % 33;
$tmp = substr($alphanum, $num, 1);
$newpass = $newpass . $tmp;
$i++;
}
$update = mysql_query("UPDATE member
SET password = '$newpass'
WHERE memberid='{$row['memberid']}'");
stripslashes(extract($row));
}
if(!$update){
echo '<p align="center">Password Could '.
'not be reset! Sorry!</p>';
} else {
include "pw-reset.htm";
include ('clsEmailpw.php');
$mailer = &new Email;
$mailer->ToMail = $email;
$mailer->FromMail = "support@summitwebcrafters.com";
$mailer->FromName = "Technical Support";
$mailer->Subject = "New Password";
$mailer->Message = "Dear $first_name,\n\n".
"You have requested a new ".
"password.".
"Below is your new login ".
"informaiton:\n\n".
"=====================\n".
"Username: $username\n".
"New Password: $newpass\n".
"=====================\n\n".
"You may login at any time ".
"at [url]http://www.bridgemilltennis.com/login_form.php\n\n[/url]".
"Thank You!\n".
"Site Administrator";
$mailer->SendMail();
}
} else
{
header("Location: [url]http://www.bridgemilltennis.com/lost_password.php[/url]");
exit;
}
break;
}
?>