【asp】请问多条件判断用户权限登陆到对应页面怎么弄(附代码)
<!--#include file="conn.asp" -->
<% if session("adminname") = "" or session("adminpassword") = "" then %>
<script>alert('你还没有登录呢');history.back();</script>
<% else %>
<%
set rswebsite=server.createobject("adodb.recordset")
sqlwebsite = "select *,web_id from website "
rswebsite.open sqlwebsite,conn,1,1
%>
<link href="css/css.css" rel="stylesheet" type="text/css">
<title>登录成功!</title>
<%
yzzh=session("adminname")
set rslx_admin=server.createobject("adodb.recordset")
sqllx_admin = "select lx_power from lx_admin where lx_username ='"&yzzh&"' "
rslx_admin.open sqllx_admin,conn,1,1
dengji = rslx_admin("lx_power")
if dengji = 1 then
%>
<style type="text/css">
<!--
.STYLE3 {color: #FF0000}
body {
background-image: url();
}
-->
</style>
<!--#include file="admin_top.asp" -->
<table width="1024" height="652" border="1" align="center" bordercolor="#F9F9F9" background="image/water.gif">
<tr>
<td width="887" height="646" align="center" valign="top" bordercolor="#3F6CB0"><table width="663" height="26" align="center">
<tr>
<td width="666" height="20" align="center" border="0"><marquee>
<span class="p12"><%=rswebsite("web_note")%></span>
</marquee>
</td>
</tr>
</table>
<p class="p11"> </p>
<p class="p11"> </p>
<p class="p11"> </p>
<p class="p11"><span class="se"><span class="red"><%=session("adminname")%></span>欢迎登录<%=rswebsite("web_title")%> 扬州市苏扬培训学校报名管理系统</span></p></td>
</tr>
</table>
<table width="1024" border="0" align="center" background="image/bg2.png">
<tr>
<td align="center" valign="top" class="se"><div align="center"><img src="image/bg2.png" width="2" height="25" />Copyright© 2009-2010 longxiang All Rights Reserved.</div></td>
</tr>
</table>
<p> </p>
<p>
<% else %>
</p>
<!--#include file="user_top.asp" -->
<table width="886" height="652" border="1" align="center" bordercolor="#F9F9F9" background="image/water.gif">
<tr>
<td width="887" height="646" align="center" valign="top" bordercolor="#3F6CB0"><table width="663" height="26" align="center">
<tr>
<td width="666" height="20" align="center" border="0"><marquee>
<span class="p12"><%=rswebsite("web_note")%></span>
</marquee>
</td>
</tr>
</table>
<p class="p11"> </p>
<p class="p11"> </p>
<p class="p11"> </p>
<p class="p11"><span class="se"><span class="red"><%=session("adminname")%></span>欢迎登录<%=rswebsite("web_title")%> 扬州市苏扬培训学校报名管理系统</span></p></td>
</tr>
</table>
<table width="880" border="0" align="center" background="image/bg2.png">
<tr>
<td align="center" valign="top" class="se"><div align="center"><img src="image/bg2.png" width="2" height="25" />Copyright© 2009-2010 longxiang All Rights Reserved.</div></td>
</tr>
</table>
<p> </p>
<p>
<% end if %>
</p>
<% rslx_admin.close
set rslx_admin = nothing
%>
<% end if %>
--------------------------
疑问是这样的,自定义dengji 为数据库用户权限,一共有3个数字。
0为 admin管理员权限 (可登陆到对应页面)
1为 普通用户权限(可登陆到普通页面)
我现在在数据库里添加了一个权限为2的用户,想登陆到对应页面,请问该如何操作。
中间我添加过几次if dengji = 2,但实际登陆到的页面还是1的页面。
谢谢各位了