Wednesday, 2 May 2012

Get original URL referer with PHP


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

  session_start();

  if (!isset($_SESSION["origURL"]))
    $_SESSION["origURL"] = $_SERVER["HTTP_REFERER"];
?>


$_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.


if more ways is there Please share here..................

No comments:

Post a Comment