Tracking No. of Users Accessing The Website

Results 1 to 2 of 2

Thread: Tracking No. of Users Accessing The Website

  1. #1
    Join Date
    Dec 1969

    Default Tracking No. of Users Accessing The Website

    I want to restrict the number of users accessing my website.<BR>for instance i want to allow only 100 users to access the website at one time and display a message to 101th user that the server is busy.

  2. #2
    Join Date
    Dec 1969

    Default RE: Tracking No. of Users Accessing The Website

    You need to create a global.asa file, I suggest looking for articles on this if you don&#039;t know how, then count the number of people actively searching your site. This should be put in your global.asa file:<BR><BR>&#060;SCRIPT LANGUAGE="VBScript" RUNAT="Server"&#062;<BR><BR>Sub Session_OnStart<BR>Application.Lock<BR>Application ("visitorCount")=Application("visitorCount") + 1<BR>Application.UnLock<BR>End Sub<BR><BR>Sub Session_OnEnd<BR>Application.Lock<BR>Application(" visitorCount")=Application("visitorCount") - 1<BR>Application.UnLock<BR>End Sub<BR><BR>Sub Application_OnStart<BR>Application("visitorCount") =0<BR>End Sub<BR><BR>Sub Application_OnEnd<BR>End Sub<BR>&#060;/SCRIPT&#062;<BR><BR>then inside your default.asp page you need to get the value of the application variable, something like the code below:<BR><BR>&#060;%<BR>IF application("visitorCount") &#062;= 100 THEN<BR>%&#062;<BR>Sorry Server Busy. Please come back later.<BR><BR>&#060;%<BR>ELSE<BR>%&#062;<BR>Page content Here<BR>&#060;%<BR>END IF<BR>%&#062;<BR><BR>Hope this helps you<BR>Craig

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts