高人指点下,谢谢!

叫我梁大侠 2010-08-16 05:31:51
我这弄一个权限的问题,如果登入进来的用户权限是超级管理员index_num=0就可以添加新的管理员,而如果是普通管理员index_num=1进来的时候就不能添加新的管理员
我写的代码如下:
<%
reg = request("reg")
select case reg
case "checkqx"
call checkqx()
end select
%>
<table cellspacing="3" cellpadding="0" width="130" align="center">
<tr>
<td><a target="main" href="admin_user.asp" onClick="?reg=checkqx">管理员管理</a></td>
</tr>
<%
sub checkqx()
anm = session("admin_name")
set rs=server.CreateObject("adodb.recordset")
sql = "select * from admin_user where admin_name='"&anm&"'"
rs.open sql,conn,1,1
if not rs.eof then
if rs("index_num")=1 then
response.Write"<script>alert('你的权限不够,无法进行操作!');javascript:history.go(-1)</script>"
end if
rs.close
set rs=nothing
end if
end sub
%>
<tr>
<td><a target="main" href="admin_system.asp">网站配置</a></td>
</tr>
<tr>
<td><a target="main" href="admin_backup.asp">数据库备份</a></td>
</tr>
</table>

onClick="?reg=checkqx" 这段我怀疑写错了,可我不知道怎么去写
高人指点下,谢谢
...全文
21 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
叫我梁大侠 2010-08-16
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 chenyuzou 的回复:]
<td><a target="main" href="admin_user.asp?reg=checkqx">管理员管理</a></td>
[/Quote]
这位大哥正解
mark!!!
szlalala 2010-08-16
  • 打赏
  • 举报
回复
提示什么错误啊?
你的sub checkqx()函数在判断完有无权限后做什么了?什么都没做啊
漫漫2009 2010-08-16
  • 打赏
  • 举报
回复
<td><a target="main" href="admin_user.asp?reg=checkqx">管理员管理</a></td>

28,391

社区成员

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

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