SHARE
Facebook X Pinterest WhatsApp

Page Hit Counter System Page 3

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



The hit report page is straightforward. We basically loop thru
the hits table and display each  pages results and tally the
grand total for the 3 categories( daily, monthly and total). Since
we dont rotate all totals automatically we must check the hit_date
and todays date to verify if the month and day totals need to be
reported.

HIT<br /> COUNTER

Conn.Open(“web_odbc”)
Set RS = Conn.Execute(“SELECT * FROM
hits  ORDER BY total_hits DESC”)

total =
0       
Three variables to running totals

T_MONTH = 0
T_TODAY =
0

Do While NOT RS.EOF %>
td_dt =
now()

if datediff(“d”,RS(“last_dt”), td_dt) 0
then  ‘check to see if the hits are
todays

    todays_hits = 0  
‘hits not today so dont
include

else
   todays_hits =
RS(“today”)  ‘they were today so
include

end if
if datediff(“M”,RS(“last_dt”), td_dt)
0 then ‘ check to see if the hits are
this months

   MONTHS_hits =
0
else
   MONTHS_hits = RS(“MONTH”)
end if

%>

Loop

RS.Close
Conn.Close

set rs =
nothing
set conn = nothing
%>

PAGE
NAME
TOTAL
HITS
TODAY’S
HITS
THIS MONTHS
HITS
<a href="”>
           ‘print and add to running
totals




‘write out grand
totals

TOTAL PAGE HITS:

TOTAL HITS
TODAY:

TOTAL THIS
MONTH:

CURRENT ONLINE USERS :

HIGHEST NUMBER
OF SIMULTANEOUS CONNECTIONS:

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.