Send Traffic Through Site As Referer

kraze98nyc

Newbie
Joined
Nov 14, 2008
Messages
26
Reaction score
5
I'd like to send traffic from ads placed on another site. I would like the traffic to appear to come from a static page on my website.

If the visitor clicks link on orig site:

orig site link > my site > my site landing page > aff site (all automatically)

If the visitor goes directly to my site landing page it appears as a static landing page, no auto redirect.

Any thoughts how to do this?

thanks!
 
This is definitely possible with some creative PHP coding :)

This is what will happen:
-User clicks the advertisement on the original site
-The user will land on PAGE1 of your site, which will have a javascript redirect to PAGE2 (javascript redirects yield a referer that equals the page it's on)
-PAGE2 two will check the referer to see where the user came from. If they came from PAGE1, then the page will display another javascript redirect to send them to your affiliate site. (With PAGE2 being the referer.) If they came from anywhere else, the page will display its normal static content.

It is also possible to send the orig ad directly to page two, assuming you know all the places your ad will be displaying. (And so what referer the user will have when they click it.) This depends fully on how the ads work/where they are--but the method I listed with 2 pages should work in any case.
 
Anybody got any scriptage on this? Am very interested...
 
I'll put up some sample PHP code in about 4ish hours. (Don't have time atm.)
 
The first page is simple--redirects you to the 2nd page (one that will appear to have content):
HTML:
<script language=Javascript>
  window.location.href='content5.php';
</script>

The second page shows content if the referer isn't the 1st page. If it is, then it sends them to the destination. (In this case it's the referer.php script.)
PHP:
<?php
//Compare the referer to the page they SHOULD come from
if ( $_SERVER['HTTP_REFERER'] == "http://www.drkenneth.mobi/demos/bouncer5.php" || $_SERVER['HTTP_REFERER'] == "http://drkenneth.mobi/demos/bouncer5.php" )

{
//Bounce the user to the destination  
print <<<END
  <script language=Javascript>
    window.location.href='referer.php';
  </script>
END;
}
else
{
//Act innocent--they didn't come through the bounce!
print <<<END
Hey!<br>
This is an innocent little page!<br>
No scripts or anything!<br>
Just lots of awesome content!<br>
People are just going to click links and buy stuff, cuz we have REAL traffic from HERE!<br>
Just a nice, happy, user friendly referral link to <a href="referer.php">referer.php</a><br>
See, click it! It's what all your viewers are doing!
END;
}
?>

referer.php is the final landing page--ie your affiliate


Here is a demo I'm temporary hosting:
http://www.drkenneth.mobi/demos/bouncer5.php (page 1, i.e. the page you'd link an ad to)
http://www.drkenneth.mobi/demos/content5.php (page 2, if you go right to it it's just innocent content ;) )
http://www.drkenneth.mobi/demos/referer.php (the affiliate--will see page 2 as the referer)

These are safe to look at--do not load any affiliates or anything bad.

BTW: I am currently creating an application to make generating advanced bouncer scripts like this (and MUCH more complicated) quick and easy--so if you have any other ideas/good features for bouncers let me know :)

Enjoy
+rep/thanks is apprecaited :D
 
Last edited:
Hmm that's pretty neat. I used .htaccess, auto form submit with javascript and php to create mine.

G-Man
 
I'm getting an error on line 6 of the second page...

Parse error: syntax error, unexpected T_SL in xxxxxxxxxxxxx on line 6
 
I'm getting an error on line 6 of the second page...

Parse error: syntax error, unexpected T_SL in xxxxxxxxxxxxx on line 6

T_SL is the /T/oken for the /S/hift /L/eft operator (<<).
so "unexpected T_SL" means there is an occurence of << that is
syntactically incorrect. this commonly happens when you use heredoc
syntax ("<<<") and have whitespace before or after the closing
identifier.
see
http://www.php.net/manual/en/language.types.string.php#language.types.st
ring.syntax.heredoc for details.

So, make sure the final identifier (the three <<<) does not have any whitespaces before or after it--it's picky.
 
Still not working for me... i fixed the line but your website version isnt working either.... hmmm
 
Hmm... weird. I am hosting that same code on my site and it's working fine. Still the same error?
 
Oh so it's an actual webbrowser issue? Does it give an error or just not work?
 
when starting at bouncer5.php, in firefox it works as it should.
In IE it goes until the content5.php and stops there.
 
Perhaps you have javascript disabled in IE? (Hence causing the redirect not to work.)
In this case you can just add a normal link saying "Proceed" or something on the redirect page so that people w/o javascript enabled can still get where they're going AND still show that page as the referer.
 
IE7 does not handle javascript redirect referers the same way, so here's a revised version of my script:


The first page is simple--redirects you to the 2nd page (one that will appear to have content):
HTML:
 <body onload="javascript:frmTaco.submit();"> 
 <form action="content5.php" method="get" name="frmTaco">
 </form>



The second page shows content if the referer isn't the 1st page. If it is, then it sends them to the destination. (In this case it's the referer.php script.)
PHP:
<?php
//Compare the referer to the page they SHOULD come from
if ( $_SERVER['HTTP_REFERER'] == "http://www.drkenneth.mobi/demos/bouncer5.php" || $_SERVER['HTTP_REFERER'] == "http://drkenneth.mobi/demos/bouncer5.php" )

{
//Bounce the user to the destination  
print <<<END
 <body onload="javascript:frmTaco.submit();"> 
 <form action="referer.php" method="get" name="frmTaco">
 </form>
END;
}
else
{
//Act innocent--they didn't come through the bounce!
print <<<END
Hey!<br>
This is an innocent little page!<br>
No scripts or anything!<br>
Just lots of awesome content!<br>
People are just going to click links and buy stuff, cuz we have REAL traffic from HERE!<br>
Just a nice, happy, user friendly referral link to <a href="referer.php">referer.php</a><br>
See, click it! It's what all your viewers are doing!
END;
}
?>

Hope that helps anyone who was having any problems in IE7. Enjoy :)
 
thank you for the information this is very good information which help me i to increased our knowledge.
 
does this work? and can the affiliate check source code and see something fishy
 
does this work? and can the affiliate check source code and see something fishy

Nope. The decision of what is sent to the user is done serverside. I.E. when the page is visited the normal page will display. There will be NOTHING fishy they will be able to look at. (Including source.) The only way for them to see the page acts as a redirect is if they find the original ad/link somehow and actually go through the bounces.
 
Greetings,

I am running the same exact link redirect setup but it is done in php. Is there some way to make this happen purely in php and php headers? I was successful doing this in curl but I lose the IP information, which looks fishy to affiliates. I am not allowed to use Javascript, meta tags or any other html.

Let me know if this can be done.

Thanks
Kind regards
 
Back
Top