Statistics | online | Number online people do not use Global.asa to achieve online statistics
<%
SessionID = Session. SessionID
Timeout = 5
' Set the time to keep session, you can add this value
conn_string = "Driver={microsoft Access DRIVER (*.mdb)};D bq=" & Server.MapPath ("Count.mdb")
' conn_string = ' activeuser '
' Setting up your DSN = ' activeuser ' is a great way to do it because you need to include this file in all ASP scripts
Set conncount =server.createobject ("ADODB.") Connection ")
Conncount.open conn_string
' Delete session after timeout
AAA = DATEADD ("n",-timeout, Now ())
Conncount.execute ("Delete * from Count where Postdate < #" & AAA & "#")
' Keep SESSIONID
sql0 = "Select Sess from Count where sess= '" & SessionID & "" "
Set Rscheck = Conncount.execute (sql0)
If Rscheck.eof Then
sql = "INSERT into count (sess,postdate) VALUES (' & SessionID & ', '" & Now () & "")
Conncount.execute (SQL)
End If
Rscheck.close
Set Rscheck = Nothing
' Compute SessionID
SQL2 = "SELECT count (sess) from Count"
Set rs = Conncount.execute (SQL2)
Count = RS (0)
Rs.close
Set rs = Nothing
SQL3 = "SELECT * from Count"
Set Rspredel = Conncount.execute (SQL3)
Do Until rspredel.eof
Xxx=datediff ("n", Rspredel ("Postdate"), Now ())
If xxx > timeout then
Count = count-1
End If
Rspredel.movenext
Loop
Rspredel.close
Set Rspredel = Nothing
Conncount.close
Set conncount = Nothing
If Count = 0 Then
Count = 1
End If
%>
<%=count%> Active Users