Here's an easy way to know the number of active visitors on your website at any given moment. To accomplish this, we are going to use traditional ASP.
Let's begin
1) First of all, we will need to create a file that keeps the track of active users. For that, create a file called global.asa
2) Paste the following contents in it and save it:
3) Upload this file to your webroot, typically it will be wwwroot.
4) Okay, we're halfway there. Now we need to create a simple ASP file that will display the number.
5) Create an ASP file with any name, I'll use the name visitors.asp.
7) Paste the following contents in it and save it:
<
8) Upload this file anywhere on your website.
9) You're done
All you need to do now is to browse the 'visitors.asp' page and it will give the number of active visitors on your website
Your feedback is welcome
Let's begin
1) First of all, we will need to create a file that keeps the track of active users. For that, create a file called global.asa
2) Paste the following contents in it and save it:
Code:
script LANGUAGE=VBScript RUNAT=Server Sub Application_OnStart Application;ActiveVisitors = 0 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
4) Okay, we're halfway there. Now we need to create a simple ASP file that will display the number.
5) Create an ASP file with any name, I'll use the name visitors.asp.
7) Paste the following contents in it and save it:
<
Code:
%@Language=VBScript%> <DOCTYPE HTML PUBLIC ;-//W3C//DTD HTML 4.01 Transitional//EN; http;//www.w3.org/TR/html4/loose.dtd;> <html> <head> <meta http-equiv=Content-Type content=;text/html; charset=iso-8859-1> <title;Active Visitors;/title> <head> <body> <Number of users visiting this site currently=application&. ActiveVisitors> <body> <html>
9) You're done
All you need to do now is to browse the 'visitors.asp' page and it will give the number of active visitors on your website
Your feedback is welcome
Comment