QUOTE(El-Aurian @ Sep 16 2009, 07:36 PM)
I'm hoping to detect the previous page, so i can tailor what is displayed by the php, dependent on which page the user came from.
Security isn't a huge issue, i was just thinking ahead as to how i could secure it.
I'm aware that i can just add an extra hidden input into the form, but i was hoping to avoid dirtying the referrer pages, if there was a way of detecting the previous page using php.
Thanks,
Matthew Millar
Im trying to find a better way of doing this just to provide a link to the previous page, but currently using this method below
I am using a link
<a href="<?=$_SESSION['previous_page']?>">Previous Page</a>
and then this called in at the bottom of the page after the link
$_SESSION['previous_page']=htmlentities($_SERVER['REQUEST_URI']);
To then decide what was to be displayed on the page you could set up a switch, you could also use $_SERVER['QUERY_STRING'] and pass through a query on the forms action url,
Of course its not fool proof and the very reason I am now trawling the net trying to find a better way, but it sets a session variable of the last page viewed from any page you set the session.