注册 登录
编程论坛 ASP技术论坛

asp设置页面访问权限时错误

sunhhy 发布于 2013-07-14 17:35, 879 次点击
manage.asp页开头判断是否管理员权限是则显示该页,不是则跳转到a.asp
if session("userqx")<>"super" then response.redirect("a.asp")
response.end
end if
页面总是跳到a.asp页,即使userqx是super也依然跳转,请帮忙!!
7 回复
#2
elongtown2013-07-14 20:38
Response.Write(session("userqx"));
看看userqx是不是super
#3
sunhhy2013-07-14 21:58
是,用您的方法试过了
#4
elongtown2013-07-15 20:24
在win7下试了没问题啊,唯一出问题的就是then后边的要换行,不然就出错
<%
if session("userqx") <> "super" then
response.redirect("a.asp")
response.end
end if
%>
#5
ysf01812013-07-17 09:54
if session("userqx")<>"" then
if session("userqx")<>"super" then
   response.redirect("a.asp")
   response.end
end if
end if

和下面的写法,下面写法有可能出错,这个是ASP的比较特性。
if session("userqx")<>"super" and session("userqx")<> "" then
   response.redirect("a.asp")
   response.end
end if
#6
sunhhy2013-07-17 10:55
还是不行,这么简单的几句真不知是哪里出错。
#7
ysf01812013-07-17 16:01
if session("userqx")<>"" then
   if session("userqx")<>"super" then
      response.redirect("a.asp")
      response.end
   end if
else
   response.redirect("a.asp")
   response.end
end if
'再不行,只能当面传授了。
#8
sunhhy2013-07-17 17:22
还是俺老师厉害,就告诉我三个字,去空格,问题就解决了。
只许将if session("userqx")<>"super" then 一句改为
if trim(session("userqx"))<>"super" then 就ok了

1