How to realize online population statistics with ASP

Source: Internet
Author: User
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?



Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.