hosted by liquidweb


Go Back   Web Hosting Talk : Web Hosting Main Forums : Programming Discussion : Programming Tutorials : Find the active number of visitors for your web site
Reply

Programming Tutorials How-Tos related to programming, databases, and the like.
Forum Jump

Find the active number of visitors for your web site

Reply Post New Thread In Programming Tutorials Subscription
 
Send news tip View All Posts Thread Tools Search this Thread Display Modes
  #1  
Old 07-20-2006, 04:07 AM
mitto mitto is offline
Disabled
 
Join Date: Jul 2006
Posts: 116

Find the active number of visitors for your web site


Hello,

Source: http://forums.**************.com/ind...?showtopic=127

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:

Quote:
<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>
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:

Quote:
<%@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>
<h3>Number of users visiting this site currently: <%=application("ActiveVisitors")%></h3>
</body>
</html>
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!

ps: this thread is originaly posted by Vaugh at accuweb hosting forums.

Reply With Quote


Sponsored Links
Reply

Related posts from TheWhir.com
Title Type Date Posted
Phishing Attack Trends by Country Represented in Netcraft Map Web Hosting News 2012-12-13 15:13:37
Website usability – 10 tips for getting it right Blog 2012-04-27 14:11:03
Apache Gains Most Sites in November Netcraft Web Server Survey Web Hosting News 2011-11-08 21:55:29
Security Firm GeoTrust Launches Website Anti-Malware Scan Service Web Hosting News 2011-10-20 17:23:34
Active Power Names Interim President and CEO Following Jim Clishem's Resignation Web Hosting News 2011-10-18 17:01:39


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes
Postbit Selector

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump
Login:
Log in with your username and password
Username:
Password:



Forgot Password?
Advertisement:
Web Hosting News:



 

X

Welcome to WebHostingTalk.com

Create your username to jump into the discussion!

WebHostingTalk.com is the largest, most influentual web hosting community on the Internet. Join us by filling in the form below.


(4 digit year)

Already a member?