SHARE
Facebook X Pinterest WhatsApp

Page Hit Counter System

Jul 20, 2010
ServerWatch content and product recommendations are editorially independent. We may make money when you click on links to our partners. Learn More



by Bob Dombroski

I had a client that just wanted a simple report he could easily
see in real time, that would show him only what he wanted to see. He
had 5 requirements.

  • How many hits total for any page and all pages.
  • How many hits for any and all pages today.
  • How many hits for any and all pages this month.
  • How many users are currently browsing the site.
  • The number of highest simultaneuos connections throughout the
    day.

I had a client that just wanted a simple report he could easily
see in real time, that would show him only what he wanted to see. He
had 5 requirements…

I am sure there are many prepackaged solutions which may have
worked, but the task is simple enough to code in ASP. I decided to
use a database solution to track the hits.

The database table (Access Database) called hits

  1. page_name – text field max of 100   (contains the
    page name)
  2. total_hits     – long  
    (contains the total hits on page since its inception)
  3. day_hits      – long  
    (contains the total hits on page today)
  4.   month_hits – long   (contains the total hits
    on page this month)
  5.   hit_date     – Date/Time  (the
    date of the current day & month hits)

table.jpg

Pretty simple so far…and it doesn’t get any harder!

I created an include file counter.inc which is included in every
page I want counted. For my client, he did not want the
adminstration pages to inflate his hit counts so the include file
would not be within any of the admin pages.

Recommended for you...

What Is a Container? Understanding Containerization
What Is a Print Server? | How It Works and What It Does
Nisar Ahmad
Dec 8, 2023
What Is a Network Policy Server (NPS)? | Essential Guide
Virtual Servers vs. Physical Servers: Comparison and Use Cases
Ray Fernandez
Nov 14, 2023
ServerWatch Logo

ServerWatch is a top resource on servers. Explore the latest news, reviews and guides for server administrators now.

Property of TechnologyAdvice. © 2025 TechnologyAdvice. All Rights Reserved

Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.