Statistics | online | Number of people online how to achieve online population statistics with ASP
(Jaklin 2000.8.17)
I find that there are a lot of people asking this question these days. I would like to say a few words about my usage, please teach prawns.
Online number refers to the number of visitors in a period of time, the length is set by the designer.
During this period, the total number of different IP visits to this site is the current number of online. In ASP, usually use the session object to implement the statistics, the implementation code is as follows:
1. In the Golobal.asa document:
〈script language=″vbscript″runat=″server″〉
Sub Session_OnStart
Application (″online″) =application (″online″) +1
End Sub
Sub Session_OnEnd
Application (″online″) =application (″online″)-1
End Sub
Sub Application_OnStart
Application (″online″) =0
End Sub
Sub Application_OnEnd
Application (″online″) =0
End Sub
〈/script〉
2. online.asp file Content
〈% tmp=application (″online″)
TMP=CSTR (TMP)
Dim disp (20)
Dim images (20)
Dbbits=len (TMP)
For i= 1 to Dbbits
Disp (i) =left (right (tmp,i), I-(i-1))
Next
For I=dbbits to 1 step-1
Images (i) =″〈img src=http://www.163design.net/a/q/″&″http://xxxx.com.cn/pic″&″/″&disp (i) &″.gif〉″
Response.write″document.write (′″&images (i) &″′); ″
Next%〉
If the prawn had a better way, tell me by the way: Fz_chenjl@163.net. Ok?