Previous Page tracking with sessions

Hi

I am trying to keep track of the previous page in my multi part form.
I’m using sessions
I set each page with
[php] $_SESSION[‘page’]=basename($_SERVER[‘PHP_SELF’])[/php]

I call the session from whatever page and it tells me the last page ok

Problem is if I hit the refresh button it instead gives me the page name of the present page as the session is now updated.
How can i stop it updating and just giving me the previous page?

You can use the value of $_SERVER[‘HTTP_REFERRER’], which stores the value of the page that sent the request for the current page the user is on the be loaded (IE the page the user clicked a link to get to the current page)

Note that this value can be forged, and sometimes isn’t even there, so using it for security reasons is not recommended. However, for what you intend to use it for it should be fine

Sponsor our Newsletter | Privacy Policy | Terms of Service