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

求判断登录的代码

E小韭 发布于 2012-04-06 15:33, 617 次点击
如何在一个登录框中,判断登录的是学生还是老师或者是管理员。。选择用radio控件。。具体可以用vbscript实现,求代码
5 回复
#2
icecool2012-04-12 22:34
既然是自动判断为什么不要RADIO控件选择呢?

还是是让登陆用户自已选择身份?
#3
aspic2012-04-14 20:42
单选按钮。。。选择不同项就是不同角色 这个好像很简单的吧 不要动不动就求代码 要动脑子
#4
ysf01812012-04-19 14:09
表,a

字段:a.username a.password  a.fenlei

a.fenlei = 1 为 学生   2 为教员 等看你自己设置。

rs.open "select * from a where username ='"&参数&"'",conn,1,1
if not rs.eof then
   if cstr(rs("password"))="参数"then
      fenlei = rs("fenlei")
      if int(fenlei) = 1 then
         '干什么
      end if
      if int(fenlei) = 2 then
        '干什么

      end if
   else
     response.write "密码有误"   
     response.end
   end if
else
   response.write "无帐号"
   response.end
end if
#5
E小韭2012-04-21 00:25
呵呵!!已经编写出来了。。用的if elseif语句。。好久没上来看帖子了。
#6
E小韭2012-04-21 00:26
回复 3楼 aspic
用的就是单选按钮,之前是因为if语句中的一点点错误。。
1