This code snippet shows how to show how
many active users there are on your site , this is quite
widely used on the internet.
using your favorite text editor create
the file global.asa and enter the code below
<SCRIPT LANGUAGE=VBScript RUNAT = Server>
Sub Application_OnStart
Application(“visits”)=0
Application(“Active”)=0
End Sub
Sub Application_OnEnd
Sub Session_OnStart
’set timeout to 20 mins
Session.Timeout = 20
Session(“Start”) = Now
‘increase count by 1
Application.lock
Application(“visits”) = Application(“visits”) + 1
intTotal_visitors = Application(“visits”)
Application.unlock
Session(“VisitorID”) = intTotal_visitors
Application.lock
Application(“Active”) = Application(“Active”) + 1
Application.unlock
End Sub
Session_OnEnd
‘decrease by 1 when session ends
Application.lock
Application(“Active”) = Application(“Active”) – 1
Application.unlock
End Sub
</script>
Now add the following to a page to count the
active users
<b><%= Session(“VisitorID”)%></b>
visit(s)
<b><%= Application(“Active”)%></b>
visitor online
No related posts.
Related posts brought to you by Yet Another Related Posts Plugin.







































Dear…
I would like you to help me about code in Aspx.
Active User, I would like you to send me your project that
show about Active User. Database store Active User in Access 2003. Please help me ……
I really need your help….. Please …..
dara_cambodian@yahoo.com
Please send me with my above E-mail…