我想让不同的用户登录不同的页面,请问那里错了?
<%
If IsEmpty(Session("Passed")) Then
Session("Passed") = False
End If
If Session("Passed")=False Then
name = Request.Form("name")
password = Request.Form("password")
If name = "" Then
Errmsg = "请输入用户名和密码"
Else
'定义Recordset对象
Set rs=Server.CreateObject("ADODB.Recordset")
Set rs.ActiveConnection = Conn
rs.CursorType = 3
rs.Open "SELECT * FROM "& request.Form("kind") &" WHERE UserName='" & Trim(UserName) & "'"
If rs.EOF Then
Errmsg = "用户不存在"
Else
If UserPwd <> rs.Fields("password") Then
Errmsg = "密码不正确"
Else '登录成功
Errmsg = ""
Session("Passed") = True
Session("name") = rs.Fields("name")
Session("Id") = rs.Fields("Id")
Sub choosekind()
If Request.Form("kind")=amdin then
' response.redirect("admin.asp")
else if request.Form("kind")=teacher then
Response.Redirect("teacher.asp")
else if request.Form("kind")=student then
response.Redirect("student.asp")
End If
end sub
End If
End If
End If
End If
%>