ASP新手求大虾指点:用户管理问题
我想在删除用户部分做一个限制,就是不能删除user表中useradmin值为3的用户,下面是已经做好的的删除用户代码,在这个基础上怎么加啊?求大侠指点,最好写出详细代码
<%
dim userid,sql
response.buffer=true
Response.Expires=0
userid=Request.Querystring("id")
sql="delete from user where username='"&userid&"'"
set rs=conn.execute (sql)
Response.Write "<html><body><center>成功删除!<p>"
Response.Write "<a href=mnguser.asp>返回查看</a>"
Response.Write "</center></body></html>"
Conn.Close
Set Conn=Nothing
%>
[解决办法]
sql="delete from user where username='"&userid&"'"
改为
sql="delete from user where username='"&userid&"' and useradmin<>3"
[解决办法]
useradmin=4 ‘获取到当前操作管理员的权限级别sql="delete from user where username='"&userid&"' and useradmin<"&useradmin