Ok, I checked again but no use.
I should have mentioned earlier that the page I want to act as the referral, is my wordpress blog. Maybe that's the reason for some reason. That means I had to edit its index file there. Doesn't redirect to affiliate offer, but only lands you on the blog.
Sounds like you need to do redirects for you blog links and stick the code in there.
So, on your legitimate looking blog page you have "if you like to try blah blah, >click here>"
Your code for the link would be something like <a href="yoursite.com/links/whereyouwantthemtogo.php">blah</a>
then you create a links directory
then whereyouwanttogo.php contains the conditional from Genjutsu's code with an else clause Like so:
Code:
<?php
$site1 = "http://www.site1.com";
$thissite = "http://yourblogname.com/appropriatepost.html";
$affiliate_link = "http://www.youroffer.com";
if($_SERVER['HTTP_REFERER'] == $site1)
{
echo "<body onload=\"javascript:frmClickTracking.submit();\">";
echo "<form action=\"" . $affiliate_link . "\" method=\"post\" name=\"frmClickTracking\">";
echo "</form>";
}
elseif ($_SERVER['HTTP_REFERER'] == $thissite)
{
echo "We're sorry there was a problem with the server. Please click this link.";
echo "<a href=\"http://youraffiliatelink.com\">click here<a>";
}
else
echo "<META http-equiv=\"refresh\" content=\"0;URL=http://www.yourafflink.com"> ";
?>
I'm not sure about the syntax in the elseif statement but I'll check it out when I get a chance.
Anyway, if I'm seeing this right, any traffic coming from your original site will now redirect showing yoursite/whereyouwantogo.php as the referrer. Put one in the win column.
If you put up a blog post and click the link (links/whereyouwant.php), it will show your site as the referrer BUT only if they click the new link generated by the "server error." What will be passed isn't the original blog post, but the /links/etc part.
This is important because I would imagine the first thing an AM would do is just type in the link. http://www.yoursite.com/whereyouwantthemtogo.php.
If an AM types this in directly, they'll just get an instant redirect to the merchant's page with a blank referrer. They'll go, "hmmmm" and go look around your blog for a related post.
They'll see the link in the post.
Click it.
And what shows up in their report is exactly the same link that will appear from your blackhat traffic.
Another one in the win column.
I suppose you could also use the javascript directly from the blogpost also. Probably any number of ways to do this actually.
I'll actually try to test all this out this weekend.
This was an "off the top of my head" thing while I was at work.
If you get a chance to try it, let me know if it works out.