I had been searching for a similar solution, blank the referrer, but only to count unique visits from a referring website. The problem I had was that, if someone visited my site from a particular link, the visit counter would go up, but if that person refreshed the page, the visitor counter was still going up.
I used google to visit several resources on this topic and yes it was very very difficult to find the answer until someone pointed me to look at php.net for solution.
I found the solution in using
header('Refresh: 0; url=index.php');
But just the above code is not the solution. Solution lies in its placement. Here is the full code:
$ref=@$_SERVER[HTTP_REFERER];
$domain = parse_url($ref, PHP_URL_HOST);
If ($domain === "google.com")
{
header('Refresh: 0; url=index.php'); //Resets header info to host site so that on page refresh, the hit counter does not
} // increase but increases only when someone visits from google url again
After the "refresh", header information changes to that of host site, so on page refresh the "if" statement will not validate and the hit counter will not increase.
You can put your hit counter inside the IF block. You can also program different parameters to log blank hits to your website and different parameters to log over all pageloads/pageviews as well.
Hope it helps.....