logincheck.asp

来自「教务系统主要是老师和学生的一个平台」· ASP 代码 · 共 42 行

ASP
42
字号
<!--#include file ="connection.asp"-->
<%
 
 uid=request.form("userid")
 pwd=request.form("password")
 loginLb=trim(request.Form("user"))
 
 set rs=Server.CreateObject("ADODB.Recordset")
 if LoginLb="admin" then 
 	sqlstr="select * from 教务管理员 where adminid='" &uid & "' and adminpwd='" & pwd &"'"
	rs.open sqlstr,CN
	if not rs.eof then
		session("user")=uid
		session("lb")=loginLb
		response.redirect("jwgl.asp")
	else
		response.Redirect("index.asp")
	end if 
 end if
 if LoginLb="teacher" then
 	sqlstr="select * from 教师 where teacherno='" &uid & "' and teacherpsw='" & pwd &"'"
	rs.open sqlstr,CN
	if not rs.eof then
		session("user")=uid
		session("lb")=loginLb
		response.redirect("teacher.asp")
	else
		response.Redirect("index.asp")
	end if 
 end if
 if LoginLb="student" then
 	sqlstr="select * from 学生 where studentno='" &uid & "' and password='" & pwd &"'"
	rs.open sqlstr,CN
	if not rs.eof then
		session("user")=uid
		session("lb")=loginLb
		response.redirect("student.asp")
	else
		response.Redirect("index.asp")
	end if 
 end if
%>

⌨️ 快捷键说明

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