I have a PHP script where I was trying to track down where an error comes from and I added this:
$_SERVER['HTTP_REFERRER']
the error was kind of sporadic and I could not locate its source. It just happened again and here are the logs from the server:
referer: http://www.comehike.com/hikes/scheduled_hike.php?hike_id=164
But when I revisit that page, the error does not happen.
What was the error? It’s probably due to a direct hit where there is no referrer or the user has privacy software that prevents that header from being sent. You should check that it is set before trying to use it.