Data | database | online | Online number ' ********* use database to Judge online list and number online
' ********* system support: asp+access, tested on WINDOWS2000+IIS5
' *********login.asp*********
<% @LANGUAGE = "VBSCRIPT"%>
<% ' on ERROR RESUME next%>
<!--#INCLUDE file= ". /fpdb/connection. ASP "-->
.
.
.
' Login to judge, slightly
.
.
' Login Successful
Session ("Name") =rs ("M_name")
Rs. Close
Strsql= "Update b_member Set m_isonline=yes,m_lasttime=now () Where m_name= '" +strname+ ""
Rs. Open Strsql,myconn
Response.Redirect "Xxx.asp"
SET rs=nothing
MyConn. Close
SET myconn=nothing
%>
' *********refresh.asp*******
<% @LANGUAGE = "VBSCRIPT"%>
<% ' on ERROR RESUME next%>
<!--#INCLUDE file= ". /fpdb/connection. ASP "-->
<meta http-equiv= "Refresh" content= "60,url=refresh.asp" >
.
.
.
' Set the 5-minute offline,rers1 ID for the previously opened connection, read the ID.
Set Rers2=server.createobject ("ADODB. RECORDSET ")
For ipage= 1 to Onlinenum
If minute (now)-minute (rers1 ("M_lasttime")) >5 or Minute (now)-minute (rers1 ("M_lasttime")) <0 Then
Resql= "Update b_member Set m_isonline=no Where m_id=" &rers1 ("m_id")
Rers2. Open Resql,myconn
End If
Rers1. MoveNext
If Rers1. EOF then Exit for
Next
Myconn.close
SET myconn=nothing
%>
' *************main.asp, the main file in the judgement shutdown to prevent direct shutdown of the browser to produce errors
<body onunload= "Javascript:window.open (' close.asp ', ' newwindow ', ' height=20, width=20, Top=0, left=0, Toolbar=no, Menubar=no, Scrollbars=no,resizable=no,location=no, Status=no ') >
' *************close.asp, ditto **********
<% @LANGUAGE =vbscript%>
<!--#INCLUDE file= ". /fpdb/connection. ASP "-->
<%on ERROR RESUME NEXT
SET Rsclo=server. CreateObject ("ADODB.") RECORDSET ")
strclo= "UPDATE b_member SET m_isonline=no,m_atarea= ' not online ' WHERE m_name= '" &session ("NAME") & ""
Rsclo. Open Strclo,myconn
Rsclo. Close
MyConn. Close
SET rsclose=nothing
SET myconn=nothing
Response.Write Err.Description
%>
<script language= "JavaScript" >
Window.close ();
</script>
That's basically it.