I am trying to find a way to blank or replace the referrer of an image. When I post an image on my site I want to be able to blank or set the referrer of the image. I also want to be able to drop a tracking code on the users pc so I can monitor what they do on my site.

I found this

PHP Code:
<?php


// The domain we want to connect to

$host "www.domain.com";

// Page we want to POST or GET

$page "trackingscript.php";

// The list of our referrer urls

$file "urls.txt";
$fp file($file);
srand((double)microtime()*1000000);
$urls $fp[array_rand($fp)];



// construct a header for our request still need to add all headers and random user Agents

$hdrs = array( 'http' => array(

'method' => "GET",



'header'=> "accept-language: en\r\n" .

"Host: $host\r\n" .

"User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:x.x.x) Gecko/20041107 Firefox/x.x\r\n" .

"Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\r\n" .

"Referer: $urls\r\n" // Setting the http-referer

"Content-Type: text/html\r\n" .

"Content-Length: 33\r\n\r\n" .

"Keep-Alive: 300\r\n"

)

);



// get the requested page from the server

// with our header as a request-header



$context stream_context_create($hdrs);

$fp fopen("http://" $host "/" $page'r'false$context);

fpassthru($fp);

fclose($fp);


?>
And it allows me to post an image and have its referrer show as my domain, but it drops the cookie on my server. Is there any way to achieve this but have the cookie set on the users pc?


I am totally new to coding so I have no idea on how to do this, although I have heard of a select few who have achieved it, but have no way to contact them which sucks.

Thanks