in.asp

来自「实验教学系统 很好用 有学生 老师 管理等模块 便于学校使用」· ASP 代码 · 共 23 行

ASP
23
字号
<%Response.Buffer=True%>
<!--#INCLUDE FILE="../odbc_connection2.asp"-->
<%
'查看有无该用户
strSql="Select UserId,UserType,email From users"
strSql=strSql & " Where UserId='" & Request.Form("UserId") & "' And password='" & Request.Form("password") & "'"
Set rs=db.Execute(strSql)
If not rs.eof and not rs.bof Then
	'如果有记录,表示有该用户,则将用户名和用户类型保存到Session中
	Session("UserId")=rs("UserId")
	Session("UserType")=rs("UserType")
	'如果是普通用户,重定向到首页;如果是管理员,重定向到管理员页面
	If Session("UserType")="A" Then
		Response.Redirect "../admin/index.asp"
	ELse
		Response.Redirect "../index.asp"
	End If
Else
	'如果没有记录,表示没有该用户,请给出提示信息
	Response.Write "对不起,用户名或密码有误,请<a href='../index.asp'>返回首页</a>重新登录"
End If
%>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?