Hi
I have the following snippet in my script as a simple fraud prevention device, to avoid counting clicks that do not originate from the same website. What are your comments on it?
I suspect that some browsers do not provide the HTTP_REFERER header, which causes clicks to be ignored when they could be counted. On the other hand quite a few of the clicks seem to come from same domain IPs, so the device may fulfill its function well enough.
Do you use anything similar on your site?
I have the following snippet in my script as a simple fraud prevention device, to avoid counting clicks that do not originate from the same website. What are your comments on it?
PHP:
function check_referer()
{
$ref = $_SERVER['HTTP_REFERER'];
$domain = $_SERVER['SERVER_NAME'];
return (preg_match("/^http:\/\/$domain/", $ref) == 1);
}
I suspect that some browsers do not provide the HTTP_REFERER header, which causes clicks to be ignored when they could be counted. On the other hand quite a few of the clicks seem to come from same domain IPs, so the device may fulfill its function well enough.
Do you use anything similar on your site?





