Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get original URL referer with PHP?

I am using $_SERVER['HTTP_REFERER']; to get the referer Url. It works as expected until the user clicks another page and the referer changes to the last page.

How do I store the original referring Url?

like image 778
Keith Donegan Avatar asked Dec 08 '09 04:12

Keith Donegan


1 Answers

Store it either in a cookie (if it's acceptable for your situation), or in a session variable.

session_start();  if ( !isset( $_SESSION["origURL"] ) )     $_SESSION["origURL"] = $_SERVER["HTTP_REFERER"]; 
like image 136
Sampson Avatar answered Sep 28 '22 04:09

Sampson