check.asp

来自「自由领域ASP+WAP同学录(V1.0)系统是一套仿ChinaRen的即可用电脑」· ASP 代码 · 共 68 行

ASP
68
字号
<%@LANGUAGE="VBSCRIPT"  CODEPAGE="65001"%>
<!--#include file="conn.asp"-->
<%
username=request.form("username")
password=request.form("password")
phoneid=request.servervariables("HTTP_X_UP_CALLING_LINE_ID")
response.ContentType="text/vnd.wap.wml;charset=utf-8"
if username="" or password="" then
session("error")=4 //非法登录
response.redirect("error.asp")
end if
%>
<%
online
set rs=server.createobject("ADODB.RECORDSET")
rs.open "select ec.studentid,ec.password,ec.sname,ec.lastedtime,ec.usertype,ec.logintimes from ec",conn,1,3
while not rs.eof
if rs("studentid")=username and rs("password")=password then
session("name")=rs("sname")
session("studentid")=rs("studentid")
conn.execute ("update ec set logintimes=logintimes+1,lastedtime='"&now()&"' where studentid='"&username&"'")
conn.execute  ("update online set sname='"&rs("studentid")&"' where ip='"&Trim(Session("user_ip"))&"'")
rs.close
set rs=nothing
conn.close
set conn=nothing
response.redirect("main.asp")
else 
rs.movenext
end if
wend
rs.close
set rs=nothing
conn.close
set conn=nothing
response.redirect("error.asp")
%>
<%
function online	
	dim user_ip,rs
	user_ip=Session("user_ip")
	If user_ip="" Then
		session("user_ip")=getuserip
		user_ip=Session("user_ip")
	End If

	set rs=conn.execute ("select * from online where ip='"&user_ip&"'")
	if rs.eof Then
		conn.execute ("insert into online(ip,sname,entertime,newtime) values ('"&user_ip&"',null,'"&now()&"','"&now()&"')")
	Else
		conn.execute ("update online set newtime='"&now()&"' where ip='"&user_ip&"'")
	End If
          rs.close
set rs=nothing
           conn.execute ("delete from online where datediff('s',newtime,now())>1200")
	end function



function getuserip
	dim tempuserip
	Randomize
	tempuserip=Request.ServerVariables("Remote_host")
	tempuserip=tempuserip&":"&Fix(Rnd*10000)
	getuserip=tempuserip
end function

%>aaa

⌨️ 快捷键说明

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