PHP Login Redirect - Multiple Users

You don't add it. Its a server global. It will only work if A) your browser is sending it and B) You navigated to that page from a different page meaning there has to be history in the user's browser. Just because its not in your phpinfo file doesn't mean you don't have it. I looked at my phpinfo, its not there but when I tested it, it worked fine. The better thing to do would be 
 
session_start(); // not sure if you have this line anywhere yet, I'm assuming you do but put it in here just in case
if(!isset($_SESSION['referrer']) && isset($_SERVER['HTTP_REFERER'])) 
{ 
$_SESSION['referrer'] = $_SERVER['HTTP_REFERER'];
echo $_SESSION['referrer'];
}

?> 
Now your session will only be set if there is something in the REFERER. Also phpinfo will only show the referer if its not empty. In your case it likely was empty.









or


when you submit the login, those referrers are updated with the login url...


what you want to do, i guess, is use either a session variable to store the referrer to the login page, or a hidden form variable:


$_SESSION['referer'] = $_SERVER['HTTP_REFERER'];

// or

echo "< input ."'="" http_referer']="" name="referer" type="hidden" value="". $_SERVER[" />];";



http://www.codingforums.com/archive/index.php/t-72885.html




$("#cbAllStates").click(function() {
   CheckUncheckAllCheckBoxes("#divChilds", this.checked);
});

Post a Comment

1 Comments

  1. Great information...I am happy to find this post Very Helpful for me, as it contains lot of information. We are the Best Mobile App Development.

    ReplyDelete