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

请教高手

yaohu 发布于 2008-04-30 21:26, 422 次点击
用ASP+access,在只有一个数据库表的情况下,如何是不同身份的登陆用户在同一个登陆窗口中,进入系统后拥有不同的权限。
权限我已经在数据库中设置了
只是我不能实现正确的跳转!!
我需要asp的源代码

再次谢谢大家的帮忙!!!!
7 回复
#2
multiple19022008-04-30 22:00
怎么可能给你源代码?没法具体问题具体分析呀。
#3
multiple19022008-04-30 22:00
走进商店说给你一件衣服?怎么可能合身呢
#4
yaohu2008-04-30 22:11
各位别生气
这就给代码
#5
yaohu2008-04-30 22:14
<%
    set conn= Server.CreateObject("adodb.connection")
    cs="provider=microsoft.jet.oledb.4.0;data source="
    conn.connectionstring=cs & server.MapPath("info-share.mdb")
    conn.open
 %>
 <%  
    set rs= Server.CreateObject("adodb.recordset")
       dim strname,pword
         strname=request.Form("user1")
         pword=request.Form("password1")
        
         sql="select * from [user]"
         sql=sql & "where username='"&trim(strname)&"'"
         rs.open sql,conn,1,3
                 
    if strname="" then
    response.Write("账号不能为空!<p></p>")
%>
<a href="index.html">返回!</a>
<%
   response.End
   end if
     if pword="" then
        response.Write("密码不能为空!<p></p>")
%>
<a href="index.html">返回!</a>
<%
  response.End
  end if
  
   if rs.recordcount=1 then
       if  rs("userpassword")=pword then
           session("name")=strname
           response.Redirect("user-view.html")
         else
              
%>
<a href="index.html">密码错误,请重新输入!</a>               
<%            end if          
    else       
%>
<a href="index.html"> 账号错误,请重新输入!</a>

 <%   response.End
    end if
    rs.close
    set rs=nothing
 %>
 
                                                   
</body>
以上就是源码
#6
multiple19022008-04-30 22:17
权限在数据库中可以使用一个整型,数越大等级越高
进入某个页面后检查当前用户的等级,大于某值就放过
#7
yaohu2008-04-30 22:20
以上的代码是经过改动的
主要是只转到一个页面
都实现不了
麻烦你们看看问题在那儿
#8
hxfly2008-05-01 00:19
用SESSION标志权限,在所有页面进入的时候检测SESSION是否允许进入,如果不允许,直接输出“权限不足”,然后下面输出跳转的页面的超连接
1