logon.asp

来自「这是一个校友录管理系统」· ASP 代码 · 共 37 行

ASP
37
字号
<!--#include file="conn.asp"-->

<%
Name=Request.Form("Name")
Password=Request.Form("Password")
%>
<%
SQL="SELECT ID,username,password,lastvst,Lastdeng,loginnum,class,online FROM [user] WHERE username='"& Name &"'"
Set LogonRS=server.Createobject("ADODB.Recordset")
LogonRS.Open SQL,Conn,3,2
IF LogonRS.Eof Then
Response.Redirect "index.asp"
Else
	IF Password=LogonRS("password") Then
		LogonRS("Lastdeng")=Now()
		LogonRS("lastvst")=Now()
		LogonRS("loginnum")=LogonRS("loginnum")+1
		LogonRS("online")="线上"
		LogonRS.Update
		Session("User")=Name
		Application("User")=Name
		
		SQL="Select * From class Where ID=" & Int(LogonRS("class"))
		Set RS1=Server.CreateObject("ADODB.Recordset")
		RS1.Open SQL,Connstr,1,1
		IF Not RS1.Eof Then
		IF RS1("admin")=LogonRS("ID") Then
		Session("Administrator1")=RS1("ID")
		End IF
		End IF
		Response.Redirect "index.asp"
	Else
		Response.Redirect "index.asp"
	End IF
End IF
Set RS=Nothing
%>

⌨️ 快捷键说明

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