1 and username='".sql_cut($_POST['userid'])."'";
$result=$db->query($sql);
$rs=mysql_fetch_array($result);
if(empty($rs[0]) or strrpos($rs[0],"@")==false)
{
echo"";
exit;
}
$pwd=substr(time(),1,6);
$html='
| 尊敬的用户'.$_POST['userid'].'您好: |
| 您的新密码为'.$pwd.'。请妥善保管好您的密码。如果您忘记了密码可以使用本站密码找回功能。
再次感谢您的使用。
'.$web_title.' |
| |
';
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=gb2312' . "\r\n";
$headers .= 'From: '.$web_title.'密码找会 <'.$sitemail.'>' . "\r\n";
$headers.="天天网络密码找回";
if(mail($rs[0],"密码找会回",$html,$headers))
{
$db->query("update ".$tb."members set password='".md5($pwd)."' where username='".sql_cut($_POST['userid'])."'");
echo "";
}
else{
echo "";
}
exit;
}
?> |
| |
|
|