📄 usersave.asp
字号:
<!--#include file="HMconnection.asp"-->
<!--#include file="webconfig.asp"-->
<!--#include file="../MD5/md5.asp"-->
<%if session("username")="" then%>
<script language="vbscript">
msgbox"对不起,你尚未登陆!"
location.href="javascript:history.go(-1)"
</script>
<%else%>
<%username=session("username")
password0=md5(trim(request("password0")))
password=trim(request("password"))
password2=trim(request("password2"))
email=trim(request("email"))
sex=trim(request("sex"))
question=trim(request("question"))
answer=trim(request("answer"))
if email="" or password0="" or password="" or password2="" or question="" or answer="" then
%>
<script language="vbscript">
msgbox"您输入的资料不全,请返回重新输入!"
location.href="javascript:history.go(-1)"
</script>
<%
response.end
end if
dim savRS
set savRS=server.createobject("adodb.recordset")
savRS.open "select * from user where username='"&username&"' and password='"&password0&"'",conn,1,3
if savRS.bof and savRS.eof then
savRS.close
set savRS=nothing
%>
<script language="vbscript">
msgbox"您输入的原密码有误,请仔细检查!"
location.href="javascript:history.go(-1)"
</script>
<%response.end
end if
savRS.close
set savRS=nothing
if password<>password2 then
%>
<script language="vbscript">
msgbox"您输入的密码和确认密码不一致!"
location.href="javascript:history.go(-1)"
</script>
<%
response.end
end if
if not(instr(email,".")<>0 and instr(email,"@")<>0 and len(eMail)>6) then
%>
<script language="vbscript">
msgbox"您输入的email格式不正确!"
location.href="javascript:history.go(-1)"
</script>
<%
response.end
end if%>
<%dim esavRS
password=md5(password)
set esavRS=server.createobject("adodb.recordset")
esavRS.open "select * from user where username='"&session("username")&"'",conn,1,3
esavRS("email")=email
esavRS("password")=password
esavRS("question")=question
esavRS("answer")=MD5(answer)
esavRS("sex")=sex
esavRS("online")=1
grade=esavRS("grade")
esavRS.update
esavRS.close
session("username")=session("username")
session("password")=password
session("grade")=grade
%>
<%
end if
set esavRS=nothing
%>
<script language="vbscript">
msgbox"操作成功,确认返回首页!"
location.href="../index.asp"
</script>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -