Apache/php

Lars Eighner luvbeastie at larseighner.com
Thu Feb 12 04:07:08 PST 2009


On Thu, 12 Feb 2009, Fbsd1 wrote:

> I have php code on home page to count how many times it is accessed from
> the internet.  Problem is pages deeper in website can jump back direct to
> home page and this again gets counted.

This is one of many ways that counters can be wildly inaccurate and is among
the reasons that mature web sites don't use counters (or at least don't
display them).

> Is there any way to give the php counter routine intelligent so it will 
> bypass bumping the counter on accesses coming from pages in the site?

Sure.  You can just not bump the counter when HTTP_REFERER is a page at your
site.  There are increasingly more complex ways to eliminate *some* other
sources of inaccuracy, but you get nearer to redesigning the site to suit
the counter, which is silly in most cases.  Analysis of server logs is the
real way to go about serious statistics, although there still are sources of
inaccuracies which cannot be reduced.

-- 
Lars Eighner
http://www.larseighner.com/index.html
8800 N IH35 APT 1191 AUSTIN TX 78753-5266



More information about the freebsd-questions mailing list