asp 对象关闭时,不允许操作.
<%username=Request.Form("username")passwordold=Request.Form("passwordold")passwordnew...
<%
username=Request.Form("username")
passwordold=Request.Form("passwordold")
passwordnew=Request.Form("passwordnew")
if username <> "" and passwordold <> "" and passwordnew <> "" then
set rs1 = Server.CreateObject("ADODB.recordSet")
sql1 = "select * from users where username='"&username&"' and password='"&passwordold&"'"
rs1.open sql1,conn,1,1
if rs1.recordcount = 1 then
set rs = Server.CreateObject("ADODB.recordSet")
sql = "update users set password='"&passwordnew&"' where username='"&username&"'"
rs.open sql,conn,1,1
if rs.recordcount = 1 then
Response.Redirect("pwd.asp")
Response.End()
rs.close
set rs=nothing
end if
else
response.write"密码输入错误"
end if
end if
%>
错误在第26行 if rs.recordcount = 1 then,但是查看数据也执行了,请问怎么处理,谢谢! 展开
username=Request.Form("username")
passwordold=Request.Form("passwordold")
passwordnew=Request.Form("passwordnew")
if username <> "" and passwordold <> "" and passwordnew <> "" then
set rs1 = Server.CreateObject("ADODB.recordSet")
sql1 = "select * from users where username='"&username&"' and password='"&passwordold&"'"
rs1.open sql1,conn,1,1
if rs1.recordcount = 1 then
set rs = Server.CreateObject("ADODB.recordSet")
sql = "update users set password='"&passwordnew&"' where username='"&username&"'"
rs.open sql,conn,1,1
if rs.recordcount = 1 then
Response.Redirect("pwd.asp")
Response.End()
rs.close
set rs=nothing
end if
else
response.write"密码输入错误"
end if
end if
%>
错误在第26行 if rs.recordcount = 1 then,但是查看数据也执行了,请问怎么处理,谢谢! 展开
展开全部
<%
username=Request.Form("username")
passwordold=Request.Form("passwordold")
passwordnew=Request.Form("passwordnew")
if username <> "" and passwordold <> "" and passwordnew <> "" then
set rs1 = Server.CreateObject("ADODB.recordSet")
sql1 = "select * from users where username='"&username&"' and password='"&passwordold&"'"
rs1.open sql1,conn,1,1
if rs1.recordcount = 1 then
set rs = Server.CreateObject("ADODB.recordSet")
sql = "update users set password='"&passwordnew&"' where username='"&username&"'"
rs.open sql,conn,1,1
if rs.recordcount = 1 then
Response.Redirect("pwd.asp")
Response.End()
else
response.write"密码输入错误"
end if
end if
rs.close
set rs=nothing
rs1.close
set rs1=nothing
end if
%>
username=Request.Form("username")
passwordold=Request.Form("passwordold")
passwordnew=Request.Form("passwordnew")
if username <> "" and passwordold <> "" and passwordnew <> "" then
set rs1 = Server.CreateObject("ADODB.recordSet")
sql1 = "select * from users where username='"&username&"' and password='"&passwordold&"'"
rs1.open sql1,conn,1,1
if rs1.recordcount = 1 then
set rs = Server.CreateObject("ADODB.recordSet")
sql = "update users set password='"&passwordnew&"' where username='"&username&"'"
rs.open sql,conn,1,1
if rs.recordcount = 1 then
Response.Redirect("pwd.asp")
Response.End()
else
response.write"密码输入错误"
end if
end if
rs.close
set rs=nothing
rs1.close
set rs1=nothing
end if
%>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询