I'm doing a traffic module for a site and I encounter a problem. I want to know how to determine witch hits are direct hits on the site and witch hits come from other sites and witch hits have their referrer blocked!
I’m trying something like this:
<?php
if (isset($_SERVER['HTTP_REFERER'])) {
if (empty($_SERVER['HTTP_REFERER'])) {
echo "Referer is blocked!";
} else {
echo $_SERVER['HTTP_REFERER'];
}
} else {
echo "Direct hit!";
}
?>