ok guys here is what I have for this problem.
1. you need to make one more file in the same directory as your php/jpg image and name it: "c.txt" - open it and insert 0 in it.
2. next open your php and inside you insert this
<?
if(!$_SERVER['HTTP_REFERER']){
//
} else {
$ration = 5;
$c = file_get_contents("c.txt");
if($c == $ration){
header("location: http://affilate_url"); //change your affiliate link
$add = 0;
$fp = fopen("c.txt", "w");
fputs($fp, $add);
}
if($c != $ration){
$add = $c+1;
$fp = fopen("c.txt", "w");
fputs($fp, $add);
}
}
?>
3. If you want a 1:10 ration change the $ration value inside of the php with 9, if you want a 1:5 change it to 4.
4. save your file and start stuffing :P. It works I have just tested this.
Hope it helps you ...