急!ASP 登录界面有三种用户,如何实现登录后跳转到各自的主页面 20

从一个登陆界面登陆,进入各自的主页分别是student.asp,teacher.asp,parents.asp,菜鸟不知道怎么改啊代码是'***Validatereque... 从一个登陆界面登陆,进入各自的主页分别是student.asp,teacher.asp,parents.asp,菜鸟不知道怎么改啊
代码是
' *** Validate request to log in to this site.
MM_LoginAction = Request.ServerVariables("URL")
If Request.QueryString <> "" Then MM_LoginAction = MM_LoginAction + "?" + Server.HTMLEncode(Request.QueryString)
MM_valUsername = CStr(Request.Form("username"))
If MM_valUsername <> "" Then
Dim MM_fldUserAuthorization
Dim MM_redirectLoginSuccess
Dim MM_redirectLoginFailed
Dim MM_loginSQL
Dim MM_rsUser
Dim MM_rsUser_cmd

MM_fldUserAuthorization = "authority"
MM_redirectLoginSuccess = "welcome.asp"
MM_redirectLoginFailed = "loginfail.asp"

MM_loginSQL = "SELECT username, password"
If MM_fldUserAuthorization <> "" Then MM_loginSQL = MM_loginSQL & "," & MM_fldUserAuthorization
MM_loginSQL = MM_loginSQL & " FROM member WHERE username = ? AND password = ?"
Set MM_rsUser_cmd = Server.CreateObject ("ADODB.Command")
MM_rsUser_cmd.ActiveConnection = MM_user_STRING
MM_rsUser_cmd.CommandText = MM_loginSQL
MM_rsUser_cmd.Parameters.Append MM_rsUser_cmd.CreateParameter("param1", 200, 1, 255, MM_valUsername) ' adVarChar
MM_rsUser_cmd.Parameters.Append MM_rsUser_cmd.CreateParameter("param2", 200, 1, 255, Request.Form("password")) ' adVarChar
MM_rsUser_cmd.Prepared = true
Set MM_rsUser = MM_rsUser_cmd.Execute
展开
 我来答
zmspu1
2015-05-06 · TA获得超过289个赞
知道小有建树答主
回答量:1425
采纳率:100%
帮助的人:969万
展开全部
给数据表增加一个身份字段(例如:sf),然后登录以后判断身份字段
sf=rs("sf")
if sf=1 then
'学生
elseif sf=2 then
'老师
else
'其他
end if
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式