Ok, I have a script here which fakes the referer, I have tested it with a url shortener and it seems to work fine (it sets the referrer to what it should). What I plan to do is set up a site especially for the 'fake' referrer so it looks all legit and source of traffic from elsewhere by running this script.
Is there any risk with this, ie will I give the network / advertiser any reason to suspect something is up with me or anything?
Is there any risk with this, ie will I give the network / advertiser any reason to suspect something is up with me or anything?
Code:
<?php
echo geturl('affiliateurl', 'fakerefferer');
function geturl($url, $referer) {
$headers[] = 'Accept: image/gif, image/x-bitmap, image/jpeg, image/pjpeg,text/html,application/xhtml+xml';
$headers[] = 'Connection: Keep-Alive';
$headers[] = 'Content-type: application/x-www-form-urlencoded;charset=UTF-8';
$useragent = 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.0.3705; .NET CLR 1.1.4322; Media Center PC 4.0)';
$process = curl_init($url);
curl_setopt($process, CURLOPT_HTTPHEADER, $headers);
curl_setopt($process, CURLOPT_HEADER, 0);
curl_setopt($process, CURLOPT_USERAGENT, $useragent);
curl_setopt($process, CURLOPT_REFERER, $referer);
curl_setopt($process, CURLOPT_TIMEOUT, 30);
curl_setopt($process, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($process, CURLOPT_FOLLOWLOCATION, 1);
$return = curl_exec($process);
curl_close($process);
return $return;
}
?>