【php开源代码栏目提醒】:网学会员为广大网友收集整理了,update_pwd_ok.php,希望对大家有所帮助!
<?php session_start(); include("conn/conn.php");
$sqls="select * from tb_user where username='".$username."' and userpwd='".$_POST[pwd]."'";
$res=new com("adodb.recordset");
$res->open($sqls,$conn,1,1);
if(!$res->eof){
$
sqls="update tb_user set userpwd='".$_POST[pass
word]."'";
$rs=new com("adodb.recordset");
$rs->open($sqls,$conn,1,1);
if(!$res->eof){
echo "<script>alert('密码更新成功!');history.back();</script>";
}else{
echo "<script>alert('密码更新失败!');history.back();</script>";
}
}else{
echo "<script>alert('您输入的密码不正确!');history.back();</script>";
}
?>