How to get referrer URL in PHP
Referrer show you where to user come on our site. In other words we can say last url of browser is Referrer URL.
<?php
$ref = getenv("HTTP_REFERER");
echo $ref;
?>
<?php
if($_SESSION['refurl']==null)
{
$ref = getenv("HTTP_REFERER");
$_SESSION['refurl']=$ref;
echo $ref;
}
else
{
echo $_SESSION['refurl'];
}
?>