From owner-freebsd-questions@FreeBSD.ORG Thu Feb 12 12:38:27 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F1EDB1065743 for ; Thu, 12 Feb 2009 12:38:27 +0000 (UTC) (envelope-from freebsd-questions@m.gmane.org) Received: from ciao.gmane.org (main.gmane.org [80.91.229.2]) by mx1.freebsd.org (Postfix) with ESMTP id ABE548FC1F for ; Thu, 12 Feb 2009 12:38:27 +0000 (UTC) (envelope-from freebsd-questions@m.gmane.org) Received: from list by ciao.gmane.org with local (Exim 4.43) id 1LXapm-0007HU-4a for freebsd-questions@freebsd.org; Thu, 12 Feb 2009 12:38:26 +0000 Received: from pool-70-21-23-175.res.east.verizon.net ([70.21.23.175]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 12 Feb 2009 12:38:26 +0000 Received: from nightrecon by pool-70-21-23-175.res.east.verizon.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 12 Feb 2009 12:38:26 +0000 X-Injected-Via-Gmane: http://gmane.org/ To: freebsd-questions@freebsd.org From: Michael Powell Followup-To: gmane.os.freebsd.questions Date: Thu, 12 Feb 2009 07:38:49 -0500 Lines: 26 Message-ID: References: <4994089B.9030708@a1poweruser.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: pool-70-21-23-175.res.east.verizon.net User-Agent: KNode/0.99.01 Sender: news Subject: Re: Apache/php X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: nightrecon@verizon.net List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Feb 2009 12:38:28 -0000 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