SHARE
Facebook X Pinterest WhatsApp

Page Hit Counter System Page 4

Jan 11, 1999
ServerWatch content and product recommendations are editorially independent. We may make money when you click on links to our partners. Learn More



The following code will need to added to your global.asa
file:

Sub application_OnStart
  Application(“a_online_user”) =
0    ‘init our 2
variables

  Application(“a_max_connect”) = 0
End
Sub

Sub Session_OnStart
  Application.Lock   ‘Lock the application
  online =
CInt(Application(“a_online_user”)
  online = online +
1
   Application(“a_online_user”) = online  
‘increment current online
users

   max_online =
CInt(Application(“a_max_connect”)
   if online >
max_online then   ‘see if the # of
users online is at the highest
point

      
Application(“a_max_connect”) = online   ‘update highest number
   end
if
   Application.Unlock
End Sub

Sub
Session_OnEnd
   Application.Lock   
‘ User left, subtract 1 from online
users

   online =
CInt(“Application(“a_online_user”)
   online = online –
1
   Application(“a_online_user”) =
online
   Application.UnLock
End Sub

THE
WORKING EXAMPLE

Recommended for you...

What Is a Container? Understanding Containerization
What Is a Print Server? | How It Works and What It Does
Nisar Ahmad
Dec 8, 2023
6 Best Linux Virtualization Software for 2024
What Is a Network Policy Server (NPS)? | Essential Guide
ServerWatch Logo

ServerWatch is a top resource on servers. Explore the latest news, reviews and guides for server administrators now.

Property of TechnologyAdvice. © 2025 TechnologyAdvice. All Rights Reserved

Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.