Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 12 Feb 2009 07:38:49 -0500
From:      Michael Powell <nightrecon@verizon.net>
To:        freebsd-questions@freebsd.org
Subject:   Re: Apache/php
Message-ID:  <gn157o$6a4$1@ger.gmane.org>
References:  <4994089B.9030708@a1poweruser.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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.
> 
> 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?
> 
[snip]

Just a very generic suggestion: Use session. If a session has not been 
established count the visit, set a session cookie and then whenever a 
jumpback happens check for session cookie. If there is a session cookie then 
don't increment. 

This is a portion of how most simple login pages function. Plenty of code 
samples and examples around the net that you can lift and get ideas. Just 
look for PHP "Login" pages.

Probably better and easier ways, but this is what jumps out first. 

-Mike







Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?gn157o$6a4$1>