【php开源代码栏目提醒】:网学会员,鉴于大家对php开源代码十分关注,论文会员在此为大家搜集整理了“lostpwd_do.php”一文,供大家参考学习!
<?php
require("include/comment.php");
$comm = new comment();
$sql = "select * from username where email='{$comm->INCOME['email']}'";
$rs = $comm->DB->execute($sql);
if($rs->RecordCount() == 1){
$new = rand(100000,999999);
$row = $rs->fields;
$
sql = "update username set password = '".md5($new)."' where user_id = {$row['user_id']}";
$comm->DB->execute($sql);
$headers .= "From: www.europewind.cn<
webmaster@europewind.cn>\nMIME-Version: 1.0\nContent-Type: text/html; charset=utf-8\n";
$subject="New Pass
word";
$msg = "尊敬的用户,您好!<br><br>";
$msg .= " 这是您的新密码:".$new."<br><br>";
$msg .= " 致<br>";
$msg .= "礼!<br><br>";
$msg .= "<center><a href='http://www.europewind.cn' target='_blank'>www.europewind.cn</center>";
if (@mail($email,$subject,$msg, $headers)){
$comm->msg('恭喜,您的新密码已经发送到您的
注册邮箱,请注意查收!','index.php');
}else{
$comm->msg("对不起,
系统无法发送邮件,请稍后重试!");
}
}else{
$comm->msg('No Email?');
}
?>