Re: capturing reloads

From: Date: Wed, 30 Jul 2003 13:33:31 +0000
Subject: Re: capturing reloads
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-157520@lists.php.net to get a copy of this message
> The only way I know is to use sessions. > > Each time they load the page, you would check a session variable that you > use store the status of a specific page. E.g. > > if($_SESSION['ReloadStatus']['ContactUs'] == true) > { > //Page has already been loaded once. This is a reload. > //--------[ Your code here ] ----------\\ > } > else > { > //Page hasn't already been loaded. This is the first visit. > //--------[ Your code here ] ----------\\ > > //Register this page as loaded: > $_SESSION['ReloadStatus']['ContactUs'] == true > } That's not going to work if all you are interested in doing is catching when the user clicks the 'Reload' button. How do you know the user didn't go to another page then come back to the 'Contact Us' page? What you probably want to do is something like this: if($_SESSION['CurrentPage'] == 'ContactUs' ) { } $_SESSSION['CurrentPage'] = 'ContactUs'; Or something along those lines. Chris

« previous php.general (#157520) next »