Building a Page Counter (Image) Using JScript.Net
page 2 of 6
Average Rating: This article has not yet been rated.
Views (Total / Last 10 Days): 28312/ 70

How Should the Counter Work?
A counter should count the number of users visiting a web page. If a user opens a specific page, the counter should increase, create a new image, and save the number of visitors in a file. The number should only increase if the visitor is new. If you increment the number of visitors every time the counter is displayed, then obviously you do not get the correct numbers of unique visitors, and will then get the number of page views instead.

So, we only need to increment the counter if we’re dealing with a new visitor. We can do this with a cookie, using standard browser functions. With a cookie, we can send the browser a flag that the current user has already visited our web page. If the user comes back within 120 seconds then we will ignore this cookie and increment the counter.

Let's start with our JScript.Net code...

View Entire Article

User Comments

Title: Firefox :s   
Name: Remi
Date: 2007-04-07 9:04:44 AM
Works great in IE! Only Firefox has some problems displaying the image. It just shows a range of weird characters :s.
Title: SPA   
Name: dheeraj Ahuja
Date: 2005-10-28 3:07:28 AM
this is gud article and it helped me alot
now wht i want is to call a server side from client routine with refering any "src",
is there any way

Product Spotlight
Product Spotlight 

Community Advice: ASP | SQL | XML | Regular Expressions | Windows

©Copyright 1998-2024  |  Page Processed at 2024-05-28 6:32:44 AM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search