ASP数据库记录不更新 10
IfRequest("ResetUserName")<>""thenResetUserName=int(Request("ResetUserName"))tn=Reque...
If Request("ResetUserName")<>"" then
ResetUserName = int(Request("ResetUserName"))
tn = Request("tn")
Response.Write "<script>alert('1"&tn&"');</script>"
If Request("Action")="ResetPassWord" then
UserName = Request("ResetUserName")
PassWord1 = Request("PassWord1")
PassWord2 = Request("PassWord2")
If PassWord1=PassWord2 then
UserMd5PassWord = md5(PassWord1)
Urs("Password") = Usermd5PassWord
set Urs=server.CreateObject("Adodb.recordset")
sql = "Update "&tn&" set Password = '"&UserMd5PassWord&"' where UserName = '"&UserName&"'"
Response.Write sql
Urs.open sql,conn,1,3
Urs.close
set Urs=Nothing
Response.Write "<script>alert('密码已重置,请重新登录!');</script>"
Response.Redirect("Index.asp")
else
Response.Write "<script>alert('两次密码填写不一样。');</script>"
end if
end if
end if
sql的值最后为:Update PsUser set Password = 'E10ADC3949BA59ABBE56E057F20F883E' where UserName = 'yx122' 展开
ResetUserName = int(Request("ResetUserName"))
tn = Request("tn")
Response.Write "<script>alert('1"&tn&"');</script>"
If Request("Action")="ResetPassWord" then
UserName = Request("ResetUserName")
PassWord1 = Request("PassWord1")
PassWord2 = Request("PassWord2")
If PassWord1=PassWord2 then
UserMd5PassWord = md5(PassWord1)
Urs("Password") = Usermd5PassWord
set Urs=server.CreateObject("Adodb.recordset")
sql = "Update "&tn&" set Password = '"&UserMd5PassWord&"' where UserName = '"&UserName&"'"
Response.Write sql
Urs.open sql,conn,1,3
Urs.close
set Urs=Nothing
Response.Write "<script>alert('密码已重置,请重新登录!');</script>"
Response.Redirect("Index.asp")
else
Response.Write "<script>alert('两次密码填写不一样。');</script>"
end if
end if
end if
sql的值最后为:Update PsUser set Password = 'E10ADC3949BA59ABBE56E057F20F883E' where UserName = 'yx122' 展开
2个回答
展开全部
set Urs=server.CreateObject("Adodb.recordset")
sql="select * from "&tn&" where Password = '"&UserMd5PassWord&"' and UserName = '"&UserName&"'" '先判断用户名和密码是否正确
if not Urs.eof then
Urs.open sql,conn,1,1
sql = "Update "&tn&" set Password = '"&UserMd5PassWord&"' where UserName = '"&UserName&"'"
conn.execute(sql)
end if
Response.Write sql
Urs.close
set Urs=Nothing
sql="select * from "&tn&" where Password = '"&UserMd5PassWord&"' and UserName = '"&UserName&"'" '先判断用户名和密码是否正确
if not Urs.eof then
Urs.open sql,conn,1,1
sql = "Update "&tn&" set Password = '"&UserMd5PassWord&"' where UserName = '"&UserName&"'"
conn.execute(sql)
end if
Response.Write sql
Urs.close
set Urs=Nothing
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询