CoderZone.org

Category: >> ASP/VB Code >> Users Online in ASP Bookmark and Share

<< lastnext >>

Snippet Name: Users Online in ASP

Description: An easy way to shows the total number of current visitors to your site. Once the user leaves and their session ends, the "online" count is reduced.

Also see:
» Get the URL of the referring page
» Yahoo Online Status
» Online PHP Tester

Comment: (none)

Author:
Language: ASP
Highlight Mode: ASP
Last Modified: December 04th, 2010

'place this code in global.asa
 
Sub Session_OnStart()
   Application.Lock
   Application("TotalUsers") = Application("TotalUsers") + 1
   Application.Unlock
End Sub
 
Sub Session_OnEnd()
    Application.Lock
    Application("TotalUsers") = Application("TotalUsers") - 1
    Application.Unlock
End Sub
 
'*********************************************************
'place this anywhere on your site to display the number of
' users currently online:
<B>Users Online: </B>
<% = Application("TotalUsers") %>
 
There haven't been any comments added for this snippet yet. You may add one if you like.  Add a comment 
© coderzone.org | users online: 9