2个回答
2013-10-13
展开全部
if Request.QueryString("action")="Edit" then
id=request("id")
OldPassword=replace(trim(Request("OldPassword")),"'","")
NewPassword=replace(trim(Request("NewPassword")),"'","")if strLength(NewPassword)>16 or strLength(NewPassword)<5 then
response.write "<script language=javascript>alert('请输入的密码位数不能小于5位或大于16位!');history.go(-1);</script>"
response.End
end ifset rs=server.createobject("adodb.recordset")
sql="select * from admin where Id="&id
rs.open sql,conn,1,3'更新管理员密码
if md5(OldPassword)<>rs("PassWord") then
response.write "<script language=javascript>alert('原密码错误,请返回重新输入!');history.go(-1);</script>"
response.End
else
rs("PassWord")=md5(NewPassword)
end if
rs.update
rs.close
id=request("id")
OldPassword=replace(trim(Request("OldPassword")),"'","")
NewPassword=replace(trim(Request("NewPassword")),"'","")if strLength(NewPassword)>16 or strLength(NewPassword)<5 then
response.write "<script language=javascript>alert('请输入的密码位数不能小于5位或大于16位!');history.go(-1);</script>"
response.End
end ifset rs=server.createobject("adodb.recordset")
sql="select * from admin where Id="&id
rs.open sql,conn,1,3'更新管理员密码
if md5(OldPassword)<>rs("PassWord") then
response.write "<script language=javascript>alert('原密码错误,请返回重新输入!');history.go(-1);</script>"
response.End
else
rs("PassWord")=md5(NewPassword)
end if
rs.update
rs.close
推荐于2018-04-05
展开全部
简单方便的:<%
if request.form("submit") = "修改密码" then
apwd=request.Form("apwd")
pwd=request.form("pwd")
uname=session("login")
if pwd<>"" then
if pwd=apwd then
sql="select*from us where user='"&uname&"'"
set rs=server.CreateObject("adodb.recordset")
rs.open sql,conn,1,3
rs("pwd")=pwd
rs.update
rs.close
set rs=nothing
Response.Write("alert('密码修改成功!')")
else
response.Write("alert('密码不相同')")
end if
else
Response.Write("alert('密码框不能为空!')")
end if
end if
%>
if request.form("submit") = "修改密码" then
apwd=request.Form("apwd")
pwd=request.form("pwd")
uname=session("login")
if pwd<>"" then
if pwd=apwd then
sql="select*from us where user='"&uname&"'"
set rs=server.CreateObject("adodb.recordset")
rs.open sql,conn,1,3
rs("pwd")=pwd
rs.update
rs.close
set rs=nothing
Response.Write("alert('密码修改成功!')")
else
response.Write("alert('密码不相同')")
end if
else
Response.Write("alert('密码框不能为空!')")
end if
end if
%>
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询