level 2
zachsn
楼主
<form name="form1" method="post" action="upload.asp">下面的代码是upload.asp网页里面的。修改用户a1(数据库里有该用户)密码的时候跳转到upload.asp,没有返回任何提示信息。修改用户a3(数据库里没有该用户)修改密码的时候同样跳转到upload.asp,没有返回任何提示信息。
下面是修改页面的代码,还希望有大神能帮帮忙。
<!-- #include file="conn.asp" -->
<%
dim admin_un1,admin_pw1
admin_un1=trim(request("un1"))
admin_pw1=trim(request("pw1"))
admin_pw2=trim(request("pw2"))
if admin_un1="" or admin_pw1="" or admin_pw2="" then
response.write "<script>alert('对不起,用户名和密码不能为空!');document.location.href='change.asp';</script>"
response.end
else
if len(request.Form("pw1"))<6 or len(request.Form("pw2"))<6 then
response.write "<script>alert('对不起,你输入密码太简单,请重新输入');document.location.href='change.asp';</script>"
response.end
else
if admin_pw1<>admin_pw2 then
response.write "<script>alert('对不起,你两次输入的密码不一致,请重新输入');document.location.href='change.asp';</script>"
response.end
end if
end if
end if
%>
<%
set conn=Server.CreateObject("ADODB.Connection")
DBPath=Server.MapPath("pandora.mdb")
conn.Open "driver={Microsoft Access Driver (*.mdb)};dbq=" & DBPath
set rs=Server.CreateObject("ADODB.Recordset")
sql="select * from info where username='"&admin_un1&"' and password='"&admin_pw1&"'"
rs.open sql,conn,1,3
if not rs.eof then
if admin_un1<>rs("username") then
response.write "<script>alert('对不起,该用户不存在,请重新输入');document.location.href='change.asp';</script>"
response.end()
else
if admin_pw1=rs("password") then
response.write "<script>alert('对不起,新密码和旧密码一致,请重新输入');document.location.href='change.asp';</script>"
response.end()
else
session.Timeout=2000
session("username")=rs("username")
session("password")=rs("password")
rs("username")=request.Form("un1")
rs("password")=request.Form("pw1")
rs("usertpye")=request.Form("dept")
rs("uptime")=now()
rs.update
rs.close
set rs=nothing
conn.close
set rs=nothing
response.Write "<script>alert('修改完成!!!');document.location.href='change.asp';</script>"
response.end()
end if
end if
end if
%>
2018年08月30日 03点08分
1
下面是修改页面的代码,还希望有大神能帮帮忙。
<!-- #include file="conn.asp" -->
<%
dim admin_un1,admin_pw1
admin_un1=trim(request("un1"))
admin_pw1=trim(request("pw1"))
admin_pw2=trim(request("pw2"))
if admin_un1="" or admin_pw1="" or admin_pw2="" then
response.write "<script>alert('对不起,用户名和密码不能为空!');document.location.href='change.asp';</script>"
response.end
else
if len(request.Form("pw1"))<6 or len(request.Form("pw2"))<6 then
response.write "<script>alert('对不起,你输入密码太简单,请重新输入');document.location.href='change.asp';</script>"
response.end
else
if admin_pw1<>admin_pw2 then
response.write "<script>alert('对不起,你两次输入的密码不一致,请重新输入');document.location.href='change.asp';</script>"
response.end
end if
end if
end if
%>
<%
set conn=Server.CreateObject("ADODB.Connection")
DBPath=Server.MapPath("pandora.mdb")
conn.Open "driver={Microsoft Access Driver (*.mdb)};dbq=" & DBPath
set rs=Server.CreateObject("ADODB.Recordset")
sql="select * from info where username='"&admin_un1&"' and password='"&admin_pw1&"'"
rs.open sql,conn,1,3
if not rs.eof then
if admin_un1<>rs("username") then
response.write "<script>alert('对不起,该用户不存在,请重新输入');document.location.href='change.asp';</script>"
response.end()
else
if admin_pw1=rs("password") then
response.write "<script>alert('对不起,新密码和旧密码一致,请重新输入');document.location.href='change.asp';</script>"
response.end()
else
session.Timeout=2000
session("username")=rs("username")
session("password")=rs("password")
rs("username")=request.Form("un1")
rs("password")=request.Form("pw1")
rs("usertpye")=request.Form("dept")
rs("uptime")=now()
rs.update
rs.close
set rs=nothing
conn.close
set rs=nothing
response.Write "<script>alert('修改完成!!!');document.location.href='change.asp';</script>"
response.end()
end if
end if
end if
%>