View Single Post
Old 10-05-2012, 05:26 PM   PM User | #2
Fou-Lu
God Emperor


 
Fou-Lu's Avatar
 
Join Date: Sep 2002
Location: Saskatoon, Saskatchewan
Posts: 15,641
Thanks: 4
Thanked 2,448 Times in 2,417 Posts
Fou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to all
Simply store it in the session and always check for if its set:
PHP Code:
<?php
session_start
();
if (!isset(
$_SESSION['ref']))
{
    
$_SESSION['ref'] = getenv('HTTP_REFERER'); // or $_SERVER['HTTP_REFERER'] would work
}

// Do your checks here.
So long as that's included in any page that needs to check, it should carry that over.
The only thing to note is that there is no guarantee that HTTP_REFERER will ever be available. That's completely up to the client if they want to provide that to you or not.
Fou-Lu is offline   Reply With Quote