Forum Moderators: DixonJones
The idea is that i know were my user has come from only if they press the submit button on my form i.e to request more information.
A bit more reliable in some cases is to use a cookie, again not 100% reliable as some users block cookies.
If you reliably want to find out from which page they came, you will have to have it as a parameter in the query string.
e.g. all links to your query page would have
?frompage=pageid it, where pageid would be a identifier of the page.
For example if you have page1.php have a link
<a href="page2.php?page=page1">
Then in the code of page2 with PHP you would have
$previouspage=$_GET['page']
If you wanted to try and use the referer in PHP it would be
$referer = $_SERVER['HTTP_REFERER'];