does this hide my referral link ?

ramyelprince

Junior Member
Joined
Nov 25, 2010
Messages
195
Reaction score
164
i have shortened my aff link with goo.gl and then used this code


does this prevent the advertiser or my network from seeing my ref link ?

<html>
<head>
<title>test</title>
</head>


<frameset cols="*,1" frameborder="0" framespacing="0" border="0">
<frame src="aff link" border="0" frameborder="0" name="main" noresize scrolling="auto"></frameset>
<noframes></noframes>
</html>
 
No, it wont help you. if you want to hide your referrer value, you need something more advanced. look for a plugin named: CPAr redirector. Though it's a WP plugin, still, you can read the code and understand the method. Basically, they are using JS self form submits to reload the new referrer (the fake one), and then fake ref sends the hit towards your way creating actually a new referrer value (the fake one)
 
You do know that just by adding a "+" in the goo.gl url they can see the referrer site.
 
I found this code better on another site
Use this code
Make it in blogger or something

Code:
<?php

// Extract URI minus http://yourblog.blogger.com
$req_url = $_SERVER['REQUEST_URI'];

function selfURL() { $s = empty($_SERVER["HTTPS"]) ? '' : ($_SERVER["HTTPS"] == "on") ? "s" : ""; $protocol = strleft(strtolower($_SERVER["SERVER_PROTOCOL"]), "/").$s; $port = ($_SERVER["SERVER_PORT"] == "80") ? "" : (":".$_SERVER["SERVER_PORT"]); return $protocol."://".$_SERVER['SERVER_NAME'].$port.$_SERVER['REQUEST_URI']; }
function strleft($s1, $s2) { return substr($s1, 0, strpos($s1, $s2)); }
$full_url = selfURL();

// Extract the urls which we need
$script_name = $_SERVER['SCRIPT_NAME'];
$current_file = basename(__FILE__);
$dir = str_replace($current_file,'',$script_name);
$dir .= '?';
$offer = str_replace($dir,'',$req_url);
$offer = remove_attempt($offer);

$fallback = 'http://www.google.com/'; 

if (!isset($_REQUEST['attempt'])) $_REQUEST['attempt'] = 0;

switch ($_REQUEST['attempt']) {
    case 0:
        echo method0($offer,$full_url);
        break;
    case 1:
        echo method1($offer,$full_url);
        break;
    case 2:
        echo method2($offer,$full_url);
        break;
    case 3:
        echo method3($offer,$fallback);
        break;
    default:
        echo method0($offer,$full_url);
}

function method0($offer,$full_url) {
    $txt = '';
    $referer = '';
    if (isset($_SERVER['HTTP_REFERER'])) $referer = $_SERVER['HTTP_REFERER'];
    if ($referer == '' ) {
       // If blank redirect
      header('Location: '.$offer);
    } else {
        // Use method 0 to blank -> works mostly for IE and FF
        $txt = '<meta http-equiv="refresh" content="0; url='.$full_url.'&attempt=1">'; 
    }
    
    return $txt;
}

function method1($offer,$full_url) {
    $txt = '';
    $referer = '';
    if (isset($_SERVER['HTTP_REFERER'])) $referer = $_SERVER['HTTP_REFERER'];
    if ($referer == '' ) {
       // If blank redirect
       header('Location: '.$offer);
    } else {
        // Use method 1 to blank
        $txt = '<script>
          function go(){
        window.frames[0].document.body.innerHTML=\'<form target="_parent" method="post" action="'.$full_url.'&attempt=2">';
        $txt .= '</form>\';
            window.frames[0].document.forms[0].submit()
          } 
        </script>
        <iframe onload="window.setTimeout(\'go()\', 99)" src="about:blank" style="visibility:hidden"></iframe>';
    }    
        
    return $txt;
}

function method2($offer,$full_url) {
    $txt = '';
    $referer = '';
    if (isset($_SERVER['HTTP_REFERER'])) $referer = $_SERVER['HTTP_REFERER'];
    if ($referer == '' ) {
       // If blank redirect
       header('Location: '.$offer);
    } else {
        // Use method 2 to blank
        $txt = '<iframe src="javascript:parent.location=\''.$full_url.'&attempt=3\'" style="visibility:hidden"></iframe>';
    }    
        
    return $txt;
}

function method3($offer,$fallback) { // All methods tried
    $referer = '';
    if (isset($_SERVER['HTTP_REFERER'])) $referer = $_SERVER['HTTP_REFERER'];
    if ($referer == '' ) {
       // If blank redirect
       header('Location: '.$offer);
    } else {
       // No methods remaining -> send to fallback
       header('Location: '.$fallback);
    }    
        
    return $txt;
}

function remove_attempt($url) {
    $i = strpos($url,'&attempt=');
    if ($i > 0 ) $url = substr($url,0,$i);
    
    return $url;
}

function create_parameters($url) {
    $p1 = strpos ($url, '?');
    $p = array();

    if ($p1 > 0 ) {
        $url_no_par = substr ($url , 0, $p1);
        $p1 = $p1 + 1;
        $url_par = substr ($url , $p1);
        $paryval = explode ('&', $url_par);
        foreach ($paryval as $value) {
            $p[] = explode ('=',$value);
        }
    }
    
    return $p;
}

?>
 
Last edited:
Back
Top