📄 modifysave.asp
字号:
<%
Response.Buffer=true
name=Request.form("name")
name=trim(name)
oldpass=Request.form("oldpass")
pass=request.form("pass")
repass=request.form("repass")
repass=trim(repass)
if instr(name,"=")<>0 or instr(name,"'")<>0 or instr(name,"|")<>0 or instr(name," ")<>0 then
response.end
end if
if instr(oldpass,"'")<>0 or instr(oldpass,"|")<>0 or instr(oldpass," ")<>0 then
response.end
end if
if instr(pass,"`")<>0 or instr(pass,"攻")<>0 or instr(pass,"or")<>0 or instr(pass,">")<>0 or instr(pass,"=")<>0 or instr(pass,"'")<>0 or instr(pass,"|")<>0 or instr(pass," ")<>0 then
response.end
end if
if instr(repass,"`")<>0 or instr(repass,"攻")<>0 or instr(repass,"or")<>0 or instr(repass,">")<>0 or instr(repass,"=")<>0 or instr(repass,"'")<>0 or instr(repass,"|")<>0 or instr(repass," ")<>0 then
response.end
end if
if name="" then
message="帐号不能为空"
elseif oldpass="" or pass="" or repass="" then
message="密码不能为空"
elseif pass<>repass then
message="密码与确认密码必须一致"
else
temppass=StrReverse(left(oldpass&"zxcvbnm,./",10))
templen=len(oldpass)
mmpassword=""
for j=1 to 10
mmpassword=mmpassword+chr(asc(mid(temppass,j,1))-templen+int(j*1.1))
next
oldpass=replace(mmpassword,"'","B")
temppass=StrReverse(left(pass&"zxcvbnm,./",10))
templen=len(pass)
mmpassword=""
for j=1 to 10
mmpassword=mmpassword+chr(asc(mid(temppass,j,1))-templen+int(j*1.1))
next
pass=replace(mmpassword,"'","B")
'ip=Request.ServerVariables("REMOTE_ADDR")
'校验用户
Set conn=Server.CreateObject("ADODB.CONNECTION")
Set rs=Server.CreateObject("ADODB.RecordSet")
connstr=Application("hg_connstr")
conn.open connstr
sql="SELECT * FROM 用户 WHERE 姓名='" & name & "' and 密码='" & oldpass& "'"
Set Rs=conn.Execute(sql)
If Rs.Bof OR Rs.Eof Then
message="对不起,你的密码不对"
else
if rs("状态")="眠" then
message="你现在休息中,不能修改密码!"
else
sql="update 用户 set 密码='" & pass & "' where 姓名='" & name & "'"
conn.Execute(sql)
message="恭喜您成功地修改了密码!"
end if
end if
conn.close
end if%>
<script language=vbscript>
MsgBox "<%=message%>"
location.href = "modify.asp"
</script>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -