No bullshit set your own referer

shadowguy

Junior Member
Joined
Nov 25, 2009
Messages
125
Reaction score
181
Ok i don't *THINK* this have already been posted (I did a search), if so forgive me.

--

How to set your own referer?

1) users click on myblackhatdomain.com (directly when e-whoring or from a link on youtube etc, it doesn't matter)



2) code for myblackhatdomain.com (snippet found on BHW)
Code:
<?php if (!isset($_COOKIE["rand1"]) || $_COOKIE["rand1"] != "rand2") {

  setcookie("rand1", "rand2", time()+3600*24*365);
  ?>

  <html>

  <head>
  <title>My offer</title>

  </head>
  <body onload="document.form1.submit();">

  <form name="form1" id="form1" method="post" action="http://www.mywhitehatdomain.com/"></form>
  <script type="text/javascript">
  document.form1.submit();
  </script>

  <div style="padding: 30px; text-align: center;">
  <a href="http://www.mywhitehatdomain.com/">Click here to continue.</a>
  </div>

  </body>
  </html>

<?php } ?>
This also sets a cookie on the client that make the page work his redirection just the first time, useful so that if it's a pay per lead people don't starting using your domain instead of the proper one (this can get you caught).
You can do other things with it (redirect to another affiliate page the second time the page is visited for example) or not using cookies at all.
To delete cookies use only the HTML part of the code.



3) users are redirected to mywhitehatdomain.com (or it can be a page in that domain like mywhitehatdomain.com/offername) sending the referer = http://www.myblackhatdomain.com (or http://www.myblackhatdomain.com/ for Internet explorer)



4) now mywhitehatdomain.com is a legit page that will make your affiliate manager happy, if you go to it without being refered from myblackhatdomain.com you will see the normal page



5) code for mywhitehatdomain.com
Code:
<?php if ( !isset($_SERVER['HTTP_REFERER']) || (($_SERVER['HTTP_REFERER'] != "http://www.myblackhatdomain.com/") && ($_SERVER['HTTP_REFERER'] != "http://www.myblackhatdomain.com")) ) { 
?>

here goes the code of your "normal" page (can be a WP blog, your site..anything)

<?php } else { ?>

<html>

  <head>
  <title>My offer</title>

  </head>
  <body onload="document.form1.submit();">

  <form name="form1" id="form1" method="post" action="http://www.affiliatenetwork.com/youraffiliatelink/"></form>
  <script type="text/javascript">
  document.form1.submit();
  </script>

  <div style="padding: 30px; text-align: center;">
  <a href="http://www.affiliatenetwork.com/youraffiliatelink/">Click here to continue.</a>
  </div>

  </body>
  </html>

<?php } ?>
6) people are sent to affiliatenetwork.com/youraffiliatelink with your www.mywhitehatdomain.com referer



7) profit.

--

So far works for all browsers with javascript enabled and it ALWAYS change referer to mywhitehatdomain.com WITHOUT having the user to click "click here to continue" (this happens only if he/she doesn't have javascript enabled)
The process lasts a couple of seconds and users can see the urls changing in their url bar. This *doesn't* cloak url bar.
I've tried Firefox 3, 3.5 - IE 6,7,8 and Chrome, on windows and linux.

Of course it's better to set your own referer then just blank it ;)

--

Please spare a thanks if you like.
 
Last edited:
Does BHCB automatically do this for you ? I'm not understanding what exactly BHCB does ... does it blank or fake the referral ?

Also , If your using the incentive content blocker BHCB on your blackhat site..... does it also have to be on your whitehat site too along with the same offers?
 
Can't CPAR take care of this easily? Or does it leak the referrer? I've always gotten paid when I've used it, but would like to hear other's experiences
 
Can't CPAR take care of this easily? Or does it leak the referrer? I've always gotten paid when I've used it, but would like to hear other's experiences

why don't you check yourself?

just install livehttpheaders on firefox, fire it up and see what referer header your GET request has :)
 
Can't CPAR take care of this easily? Or does it leak the referrer? I've always gotten paid when I've used it, but would like to hear other's experiences

Yes, CPA redirector (if well setup) takes care of this very clearly and use not obtrusive code. You can blank or fake the referrer.

That onload event based function onload="document.form1.submit();" is horrible, reminds me the 90s DHTML.
The only good thing is the cookies management.
 
Back
Top