I am having trouble logging the refering page. I try to log the refering page but when I check the database it's just a blank entry. Is there another way to log the refering page? This is the code I used:
<?php
mysql_connect("", "", "") or die(mysql_error());
mysql_select_db("") or die(mysql_error());
$re = addslashes($_SERVER["HTTP_REFERER"]);
$query="INSERT INTO `tracker`(`pagesr`) VALUES ('$re');";
$result = mysql_query($query);
if (!$result) die(mysql_error());
print_r($_SERVER); exit;
?>
The value does not get logged and when I print out the value it's a bunch of stuff that has nothing to do with the refering page, I was told that the value I was looking for was in the stuff that was printed out but I didn't see anything in there that had to do with the refering page. Can someone please tell me how to log the refering page and print it out.
NOTE: I took the host,username,password and database name out for security reasons.