Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 12 Feb 2009 06:05:39 -0600 (CST)
From:      Lars Eighner <luvbeastie@larseighner.com>
To:        Fbsd1 <fbsd1@a1poweruser.com>
Cc:        FreeBSD Questions <freebsd-questions@freebsd.org>
Subject:   Re: Apache/php
Message-ID:  <20090212055246.D78478@qroenaqrq.6qbyyneqvnyhc.pbz>
In-Reply-To: <4994089B.9030708@a1poweruser.com>
References:  <4994089B.9030708@a1poweruser.com>

next in thread | previous in thread | raw e-mail | index | archive | help

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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20090212055246.D78478>