Whos' Online Code

liunx

Guest
I want to implement this on my site. It is an asp site with a sql server 2000 backend. I have never used the global asa file. Can someone point me to a tutorial on the global asa and/or the basic structure and knowledge needed to implement this type of utility?

Thanks!Google is your friend:

<!-- m --><a class="postlink" href="http://www.google.com/search?sourceid=navclient&ie=UTF-8&rls=GGLD,GGLD:2004-02,GGLD:en&q=global%2EasaThanks">http://www.google.com/search?sourceid=n ... EasaThanks</a><!-- m -->. That is helpful. It's about time I started looking into this. But here is my problem: I have the following code in my global.asa file-


Sub Application_OnStart
Application("visitors") = 0
End Sub

Sub Session_OnStart
Application.Lock
Application("visitors") = Application("visitors") + 1
Application.UnLock
End Sub

Sub Session_OnEnd
Application.Lock
Application("visitors")=Application("visitors") - 1
Application.UnLock
End Sub


and it seems to be working except that it is not "counting down"-that is it is showing more users online than are actually online. Any ideas?I wouldn't use session to count visitors on a large site like mine. If your site is hosted in shared hosting plan, you are killing the shared server system resources. My suggestion to you is download snitzforum or mawebportal forum and look at the code for users online count. Both use DB, not session.

<!-- m --><a class="postlink" href="http://www.ex-designz.net/codemanager/default.asp">http://www.ex-designz.net/codemanager/default.asp</a><!-- m -->
DexterThanks. I will look into it! Just exactly how significant is the system resource drain. Lets say you have 100 users online at a peak time.
 
Back
Top