12-14-2011, 08:58 PM
It will show the page referrer of the page you want to show a referral from no matter where the traffic is coming from(In case you ever have to prove or send links to a network).
You can send for instance, email traffic to one of your pages that will automatically redirect to the offer and show your good page as the referral. Put up some good content on your "Referral" page and you are all set and the network is happy.
Just put this code at the top of your page and save your page as a .php file.
The only lines you have to edit are:
$searchthis = "%email%";
// This is the search string that the script looks for to determine if its sent
// to your affiliate link(And passes you page as a referral)
// or if it stays on the current page(To show networks where you referrals
// are coming from)
// and example original url the you would send to the service that will
// provide your traffic is: http://www.yoursite.com?=src=email
// The script will parse out the word email and that tells it that it should
// send the traffic to your affiliate link, but it keeps your landing page
// as the url.
I'll share more helpful information/guide soon.
Press THANKS or REP me if you found it useful.
You can send for instance, email traffic to one of your pages that will automatically redirect to the offer and show your good page as the referral. Put up some good content on your "Referral" page and you are all set and the network is happy.
PHP Code:
<?php
$url = (!empty($_SERVER['HTTPS'])) ? "https://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'] : "http://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'];
function parse($cadena,$busca){
if($busca=="") return 1;
$vi = split("%",$busca);
$offset=0;
for($n=0;$n<count($vi);$n++){
if($vi[$n]== ""){
if($vi[0]== ""){
$tieneini = 1;
}
} else {
$newoff=strpos($cadena,$vi[$n],$offset);
if($newoff!==false){
if(!$tieneini){
if($offset!=$newoff){
return false;
}
}
if($n==count($vi)-1){
if($vi[$n] != substr($cadena,strlen($cadena)-strlen($vi[$n]), strlen($vi[$n]))){
return false;
}
} else {
$offset = $newoff + strlen($vi[$n]);
}
} else {
return false;
}
}
}
return true;
}
$searchthis = "%email%";
$resp = parse($url,$searchthis);
if ($resp ==1){
header("Location:http://www.yourafiliatelink.com");
} else{
}
?>
Just put this code at the top of your page and save your page as a .php file.
The only lines you have to edit are:
$searchthis = "%email%";
// This is the search string that the script looks for to determine if its sent
// to your affiliate link(And passes you page as a referral)
// or if it stays on the current page(To show networks where you referrals
// are coming from)
// and example original url the you would send to the service that will
// provide your traffic is: http://www.yoursite.com?=src=email
// The script will parse out the word email and that tells it that it should
// send the traffic to your affiliate link, but it keeps your landing page
// as the url.
Code:
$resp = parse($url,$searchthis);
if ($resp ==1){
header("Location:http://www.yourafiliatelink.com");
// Here all you have to edit is the location of your affiliate link and that
// is where the page will redirect to.
} else{
}
I'll share more helpful information/guide soon.
Press THANKS or REP me if you found it useful.