权限无法控制

rootstock 2003-08-21 08:49:59
sqlr="select * from pw where username = '"&username&"' and password='"&password&"' "
rs.open sqlr,conn,1,1
if (rs.eof or rs.bof) then
response.write "用户名或密码不对,请重新输入!"
else
session("username")=rs("username")
session("password")=rs("password")
session("privilege")=rs("privilege")
session("email")=rs("email")
response.redirect "index.asp"
end if



网页控制权限的代码如下
<%
if session("privilege") < "6" then
response.write ("<input type=""submit"" name=""Submit"" value=""删除"">")
end if
%>

但privilege 18 的都能看到value=""删除"

为什么?
...全文
27 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
xupiao 2003-08-21
  • 打赏
  • 举报
回复
同意樓上
yancey 2003-08-21
  • 打赏
  • 举报
回复
<%
if clng(session("privilege")) < 6 then
response.write ("<input type=""submit"" name=""Submit"" value=""删除"">")
end if
%>
rootstock 2003-08-21
  • 打赏
  • 举报
回复
privilege 是 int
把privilege 换成numeric后问题还是存在的
weiming28cn 2003-08-21
  • 打赏
  • 举报
回复
很明显是privilege的值小于"6",我不知道你的privilege字段的类型是什么?如果是int的话,最好把"6" 改成数值的6,看看能不能解决!
xiaofei7569 2003-08-21
  • 打赏
  • 举报
回复
"6">"16"
这个自己多考虑一下就可以解决了,不要老是这么简单的问题也问。

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧