| The ASP Code (For your global.asa) |
|
The following ASP code will allow you to Count and Display the amount of visitors that are currently on or viewing your website.
You will have to save this ASP code into a file called 'global.asa', which must be uploaded to the root of your webserver. |
|
<SCRIPT LANGUAGE="VBScript" RUNAT="Server">
Sub Application_OnStart
Application("strVisitors") = 0
End Sub
Sub Application_OnEnd
End Sub
Sub Session_OnStart
Application.lock
Application("strVisitors")=Application("strVisitors") + 1
Application.unlock
End Sub
Sub Session_OnEnd
Application.lock
Application("strVisitors")=Application("strVisitors") - 1
Application.unlock
End Sub
</SCRIPT>
|
| The Active User Results |
Place following code where you want your Active Visitor results to appear. |
|
<%
'Write the amount of active visitors
Response.Write(Application("strVisitors"))
%> |