⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 in.asp

📁 asp开发 asp开发 asp开发 asp开发
💻 ASP
字号:
<%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 + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -