stu_login.asp

来自「学生成长管理系统V2008」· ASP 代码 · 共 28 行

ASP
28
字号
<!-- #include file="Include/Conn.asp" -->
<!-- #include file="Include/MD5.asp" -->
<%
function R(s)
R = Replace(Trim(s), "'","")
R = Replace(R, """","")

end function
	
	if Trim(Request("username"))="" or Trim(Request("password"))=""  then
		Response.Write "<script language='javascript'>alert('信息填写不完整或格式不正确!');document.location.href('Stu_Login.htm');</script>"
		Response.End()
	end if
	
	SQL="Select * from Stu where username='" & R(Trim(Request("username"))) & "' and password='"&Trim(Request("password"))&"'"
	set nrs=server.createobject("adodb.recordset")

	nrs.open SQL,conn,1,1
	if nrs.Bof and nrs.Eof then
		Response.Write "<script language='javascript'>alert('用户名或密码错误!');document.location.href('Stu_Login.htm');</script>"
		Response.End()
	else

		Session("User")=nrs("name")
		Session("username")=nrs("username")
		Response.Redirect "Stu_Index.htm"
	end if
%>

⌨️ 快捷键说明

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