Re: Distinguishing between a mouse click and a refresh?

From: Date: Mon, 04 Dec 2006 21:33:32 +0000
Subject: Re: Distinguishing between a mouse click and a refresh?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-245499@lists.php.net to get a copy of this message
Yes, sort of. lets say that your page is 'http://www.php.net' and you want to make sure your visitor got there with a click, and not a refresh... first, get the referer... $_SERVER['HTTP_REFERER']; then do something like this... $refsite = file_get_contents($_SERVER['HTTP_REFERER']); $refsite = str_replace('"','',$refsite); $refsite = str_replace('"','',$refsite); if(stristr($refsite,'href=http://www.php.net') && !stristr($refsite,"url= http://www.php.net")) { // it came from a click } else { // maybe not a click } On 12/4/06, Mark London <mrl@psfc.mit.edu> wrote:
Is there any way for PHP to know whether it is being called due to a browser refresh versus a mouse click? I think the answer is no but I just want to be sure. Thanks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php


« previous php.general (#245499) next »