asp验证 跳转

来源:百度知道 编辑:UC知道 时间:2024/06/23 05:26:27
if rec.bof and rec.eof then
if password<>rec("password") or name<>rec("username") then
response.write "<div align=center style='font-size:15pt;font-weight:bold;color:red'><br><br>账号和密码不对,您是非法管理员!<br><BR><BR><BR><BR><BR></div>"
response.End()

response.write "<div align=center><font style='font-size:11pt;color:#0077ff;cursor:hand' onclick='history.go(-1)'>返 回</font></div>"
response.End()
else
session("adminsession")="ok"
response.Redirect "index.asp"
end if

跳转失效啊
上面是错误时候才显示的啊response.write "<div align=center><font style='font-size:11pt;color:#0077ff;cursor:hand' onclick='history.go(-1)'>返 回</font></div>"
else 后面才是密码正确 再跳转啊!

response.End()

下面的

response.write "<div align=center><font style='font-size:11pt;color:#0077ff;cursor:hand' onclick='history.go(-1)'>返 回</font></div>"

是不会显示的,因你已停止输出

--------------------------------------------
response.Redirect "index.asp"
是没错的,检查一下会不会执行到这,如果条件不到这,当然跳转不了咯