july23
Senior Member
- Nov 27, 2008
- 932
- 428
First of all this is not mine, i don't own the script but it is shared for free. I just like to share this to other members that don't know this yet
Why would you want to blank the referrer and what is it good for?
Well, if you do a lot of affiliate marketing and have tapped a high converting traffic source that someone else can replicate for example Craigslist, MySpace etc you want to keep it secret. If not, you as the affiliate may get scrubbed out of the equation and the product owner can go direct to the traffic source and start making sales without needing to pay you commission.
So sending the traffic through a Double Meta Refresh will remove the referrer and make it blank so nobody knows where your traffic is coming from much like if someone directly typed in your affiliate URL in the browser.
So here it is, you need to save these as 2 separate .php files.
Goto.php
<?php
echo "<meta http-equiv=\"refresh\" content=\"0;url=http://www.yoursite.com/goto2.php\">";
?>
goto2.php
<?php
$referer = $_SERVER['HTTP_REFERER'];
if($referer == "")
{
echo "<meta http-equiv=\"refresh\" content=\"0;url=http://www.affiliate.com/link.php\">";
}
else
{
echo "<meta http-equiv=\"refresh\" content=\"0;url=http://www.yoursite.com\">";
}
?>
Then you just link your traffic to the first goto.php link, which will do a Meta Refresh and send them to the goto2.php page. The goto2.php does a simple check of the referrer, if it's blank it will forward them on to your affiliate link. If the referrer is not blank for some reason, it will just send them back to your homepage.
Under "some" conditions with some browsers they may leak the referrer, so the checking built in to the second page will ensure your referrer is 100% blanked before sending the traffic on to your affiliate.
The whole thing happens quite fast, and generally people don't realize it's even occurred. So there it is, quite simple really.
The original post is here