关于ASP登陆代码

来源:百度知道 编辑:UC知道 时间:2024/05/17 02:30:10
id username password rank time
1 admin admin 管理员 2007-11-22
2 kefu 123456 客服 2007-11-22

在这样的表上做ASP登陆 如果是管理员登陆到admin/index.asp 如果是客服就登陆到kefu/index.asp
这样的登陆如何实现?登陆之后还要显示级别
急~~急~~急

登陆页:
在登陆验证代码略。验证完毕后,写以下代码

<%
response.cookies("username")=rs("username")
response.cookies("等级")=rs("等级")
response.Redirect("chk.asp")
%>

---- chk.asp ---

<%
if request.cookies("username")="管理员" then
response.Redirect("admin/index.asp")
end if
if request.cookies("username")="客服" then
response.Redirect("kefu/index.asp")
end if
%>

在index.asp页面写入以下代码,即可显示用户名和等级

<%=rs("username")%>你好,你的等级为<%=rs("等级")%>
-------------------------------------------------------------------
把我作的登陆页作贴出来吧,
<!--#include file="fm/feng.asp" -->

<%
<!-- 判断用户名(账号)和密码正确情况-->
xm=request("xm")
if xm="" then
response.write"<SCRIPT language=JavaScript>aler