I have been trying to get $HTTP_REFERER to print or show up somewhere in a script and have had no success. I am convinced that this variable must not be available on the server config I have (but I don't know why). YES I have been accessing this page via a link from a different page (so there is a referer).
Here's some code that doesn't work as expected and what happens. Try it your self on you server and let me know if you get a different result or have another suggestion.
<pre>
<?php
print_r ($HTTP_SERVER_VARS); //prints an array with many other keys but no referer
print_r ($_SERVER); //prints an array with many other keys but no referer
echo ("$HTTP_REFERER"); //prints nothing
print_r ($HTTP_REFERER); //prints nothing
echo($_SERVER['HTTP_REFERER']); //prints nothing
echo($HTTP_SERVER_VARS['HTTP_REFERER']); //prints nothing
echo (getenv('HTTP_REFERER')); //prints nothing
?>
</pre>
Is there some server config setting I should ask my host to enable? They are running PHP4.3.2 on Apache/Intel