<body>
<%
if request("submit"<>"" then
Set Rs = Server.Createobject("Adodb.Recordset"
Sql = "Select * From account_login Where name='"&Checkstr(request("username")&"'"
Rs.open sql,conn,1,3
if rs.eof then
response.write "不存在该用户"
else
pwd1=request("newpassword"
pwd2=request("newpasswordagn"
if rs("password"<>UCASE(md5(request("oldpassword")) or pwd1<>pwd2 then
response.write "旧密码不正确或者新密码两次输入有误."
else
rs("password"=UCASE(md5(request("newpassword")))
rs.update
response.write "密码更新成功"
end if
end if
rs.close
set rs=nothing
end if
if len(document.form.newpassword.value) < 6 or len(document.form.newpassword.value) > 12 then
msgbox("错误的密码长度,请输入长度6-12位的密码!")
document.form.newpassword.focus()
checkform=false
exit function
end if
if instr(document.form.newpassword.value," ") > 0 then
msgbox("密码中不能有空格")
document.form.newpassword.focus()
checkform=false
exit function
end if
document.form.action="forget.asp?action=save"
return true
end function
</script>