ASP Live User Counter

 

This script will display the number of live visitors currently active on your web page.

 

Example

There are 316 active users

 

Script Source

 

<The following script should be copied to a file named global.asa >

<SCRIPT LANGUAGE="VBScript" RUNAT="Server">

Sub Application_OnStart
application("activevisitors")=0
End Sub

Sub Application_OnEnd
End Sub

Sub Session_OnStart
application.lock
application("activevisitors")=application("activevisitors")+1
application.unlock
End Sub

Sub Session_OnEnd
application.lock
application("activevisitors")=application("activevisitors")-1
application.unlock
End Sub

</SCRIPT>

<To include the global.asa file add the following code >

There are <% =application("activevisitors") %> active visitors

 

Please let me know if this script was helpful to you.

[rating]