| Display the Number of Users Online |
The codes contain two parts. The first part is part of the "global.asa" file which is to be placed directly under your root directory. The second part is the code to display the actual number of people online. You can also easily use the Client's Info code to find out your visitor's IP address and the time they visited your site.
The Code:
'--- codes to be placed in global.asa
<script
language=VBScript runat=Server>
Sub
Application_OnStart
Application("WhoOn") = 0
End Sub
Sub
Application_OnEnd
'---nothing here
End Sub
Sub
Session_OnStart
Session.Timeout = 20
'---lock Application variable
before updating
Application.Lock
Application("WhoOn") =
Application("WhoOn") + 1
Application.Unlock
End Sub
Sub
Session_OnEnd
Application.Lock
Application("WhoOn") =
Application("WhoOn") - 1
Application.Unlock
End Sub
</script>
code to display the actual number online
<%=Application("WhoOn")%>
online now
The Result:
Number of Users on psacake.com now: 81
perrychicker
© 1998 - 2012 psacake.com
Version 3.23
Send me One Million FREE Guaranteed Visitors