asp管理员登陆

来源:百度知道 编辑:UC知道 时间:2024/06/05 14:16:16
我想把管理员和其他人分开开登陆,第一个可以登陆第二个管理员就唔得。请问点解。
<!--#include file="conn.asp"-->
<%dim username,password
username=request.Form("username")
password=request.Form("password")
if username="" or password="" then
response.Write "<script>alert('帐号或密码不能空');location='index.asp'</script>"
else
one="select * from login where username='"&username&"' and password='"&password&"'"
set rs=conn.execute(one)
if not rs.eof then
session("zhuangtai")="ok"
session("username")=request.Form("username")
response.Write "<script>alert('登陆成功');location='houtai.asp'</script>"
one="select * from login where username='"&admin&"' and password='"&password1&"'"
set

多建一个字段,字段名字随便取.

在登录的时候,给它加个判断,如果用户名等于1的话,就继续执行下面的程序,如果不等于1,那么就显示"对不起,你不是管理员,无法登录"这样的话.

多建的那个字段,你可以直接在数据库的管理员后面写上1就可以了.

如果还有不明白,你就百度HI我..也许我能帮到你.

建立不同管理员,分配不同权限。