TheConeHead
Programmer
is there a way in PHP (not javascript) to retrieve the page someone came from like if you wanted to make a back button?
![[conehead] [conehead] [conehead]](/data/assets/smilies/conehead.gif)
![[conehead] [conehead] [conehead]](/data/assets/smilies/conehead.gif)
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
if ($_SERVER["HTTP_REFERER"]){
$back = $_SERVER["HTTP_REFERER"];
echo '<a href=\"'.$back.'\">Go back: '.$back.'</a>';
}
else
echo "<a href=\"javascript:history.go(-1);\">Go Back</a>";
php manual said:'HTTP_REFERER'
The address of the page (if any) which referred the user agent to the current page. [highlight]This is set by the user agent. Not all user agents will set this, and some provide the ability to modify HTTP_REFERER as a feature. In short, it cannot really be trusted. [/highlight]