How To DMR - 100% Safe

Alex Brooks

BANNED
Joined
Mar 17, 2009
Messages
1,197
Reaction score
298
Index.php
Code:
<?php
echo "<meta http-equiv=\"refresh\" content=\"0;url=second.php\">";
?>

Second.php
Code:
<?php
$sites = array_map("trim", file("links.txt"));
$redirect = $sites[array_rand($sites)];
$referer = $_SERVER['HTTP_REFERER']; if($referer == "")
echo "<meta http-equiv=\"refresh\"content=\"0;url=http://".$redirect."\">"; 
else
{
echo "<meta http-equiv=\"refresh\" content=\"0;url=http://www.google.com\">";  
}
?>

Links.txt
Code:
secure.hostgator.com/cgi-bin/affiliates/clickthru.cgi?id=affid
Do not include www or http:// in links.txt

Instead of most DMR methods, this is 100% safe (As far as I know) because of this:
Code:
$referer = $_SERVER['HTTP_REFERER']; if($referer == "")
echo "<meta http-equiv=\"refresh\"content=\"0;url=http://".$redirect."\">"; 
else
{
echo "<meta http-equiv=\"refresh\" content=\"0;url=http://www.google.com\">";  
}
?>
For those of you who don't understand PHP, it basically says, if the referrer is blank, then redirect to a link in links.txt - But if it isn't blank, then go to google :)
 
Checking if the referer is blank is not new. What were you using before that??

here's a single page version from drkenneth I believe

Code:
<?php
//Grab arguments from the GET string
$SEC = $_GET['S'];

//If on second bounce SEC = 1
if ( $SEC == '1' )
{
 //Validate (make sure the referer cleared)
 if ( $_SERVER['HTTP_REFERER'] == '' )
 {
   //Landing page
   $bounce_loc='referer.php';
 }
 else //Bad! dump them somewhere!
 {
   //Dump location (for metas that didn't clear)
   $bounce_loc="http://www.google.com";
 }
}
else //First time through--bounce them back!
{
 $self = $_SERVER['SCRIPT_NAME'];
 $bounce_loc="$self?S=1";
}
?>

<html>
<head>
<?php
print("<meta http-equiv=refresh content='0;url=$bounce_loc'>");
?>
</head>
<body>

</body>
</html>
 
I never said it was new, I've seen a couple of posts with DMR scripts which will leak, so I posted this one which doesn't leak and also has the option to send the traffic to differnt pages, so if your promoting [offer1] and you have [offer1] on 10 networks, you can add 10 differnt links in one page, so it'll spread out your earnings instead of just one.
 
iv tried this on IE 8, it does not work.. i get an error about not being able to modify header information
 
I would suggest redirecting to about:blank if there is still a referer that way u don't spend extra loading time on your page
 
I truly believe the best way to redirect is to do a DMR on a secure domain. ie:

youraffiliatelandingpage.com > DMR on https domain > affiliatepage.com

That way you will successfully blank on all major browsers. Browsers that don't support DMR should support blanking via https, and vice versa.

Try it out!
 
Wee thanks, I was just about to write a script to do this in php, but this saved me about 5 minutes. We all know time is money. Thanks again ;)
 
isnt working for me

something about the array rand on lines 2 and 3 of second.php

can anyone help me out?

EDIT: problem solved!
 
Last edited:
Hi, can I use DMR with CPA Redirector for Wordpress together? I have in the header.php on the firts line this
Code:
<?php if (prc_red()) exit(); ?>

Thanks for some help.
 
Index.php
Code:
<?php
echo "<meta http-equiv=\"refresh\" content=\"0;url=second.php\">";
?>
Second.php
Code:
<?php
$sites = array_map("trim", file("links.txt"));
$redirect = $sites[array_rand($sites)];
$referer = $_SERVER['HTTP_REFERER']; if($referer == "")
echo "<meta http-equiv=\"refresh\"content=\"0;url=http://".$redirect."\">"; 
else
{
echo "<meta http-equiv=\"refresh\" content=\"0;url=http://www.google.com\">";  
}
?>
Links.txt
Code:
secure.hostgator.com/cgi-bin/affiliates/clickthru.cgi?id=affid
Do not include www or http:// in links.txt

Instead of most DMR methods, this is 100% safe (As far as I know) because of this:
Code:
$referer = $_SERVER['HTTP_REFERER']; if($referer == "")
echo "<meta http-equiv=\"refresh\"content=\"0;url=http://".$redirect."\">"; 
else
{
echo "<meta http-equiv=\"refresh\" content=\"0;url=http://www.google.com\">";  
}
?>
For those of you who don't understand PHP, it basically says, if the referrer is blank, then redirect to a link in links.txt - But if it isn't blank, then go to google :)

How can I randomize the links in the links.txt

Thanks
 
I found that the above solution as well as the normal double meta refresh below loops for safari.

index.php
HTML:
<?php
echo**"<meta**http-equiv=\"refresh\"**content=\"0;url=http://www.yoursite.com/goto2.php\">";
?>

goto2.php
HTML:
<?php
$referer= $_SERVER['HTTP_REFERER'];

echo $referer;
if($referer=="")
{
echo "<meta http-equiv=\"refresh\" content=\"0;url=http://stardrifter.org/cgi-bin/ref.cgi\">";
}
else
{
echo "<meta http-equiv=\"refresh\" content=\"0;url=http://yoursite.com\">";
}
?>

Both solutions that do a double meta refresh (DMR) go into a never ending loop while using Safari 3.1.2 on mac. From what I've read Safari passes the referer differently then other browsers and it's loops forever. Anyone have some thoughts on how to break it? A client side javascript browser sniff for Safari could break it but what if the user shuts off javascript? Not the end of the world to me as it's such a small user base of people. I just really wanted to point it out to others that may not realize it and see if anyone has idea's on how to fix it or may have a solution already.


Does a secure ssl license on the first domain prevent this? (i can't currently test this)



@indy0077 try it out. I think that the code already randomizes what line it grabs. I'm not great with php but this line
HTML:
$redirect = $sites[array_rand($sites)];
says randomize the array to me.



UPDATE: It also loops for Google chrome and opera 10.00 Alpha. Does anyone have a work around for this? If you need to see an example PM me.
 
Last edited:
I believe I've successfully set up a DMR but I'm not sure how to test it?

I've tried google but have yet to find a clear way to test if the referrer is being banked or not. I want to make sure before I start promoting obviously.

Anyone got any ideas?
 
I believe I've successfully set up a DMR but I'm not sure how to test it?

I've tried google but have yet to find a clear way to test if the referrer is being banked or not. I want to make sure before I start promoting obviously.

Anyone got any ideas?
Setup a page on your own server and put the following code in it:
PHP:
<?php
	echo 'Referer: '.$_SERVER['HTTP_REFERER'];
?>

Use that page as the "end point" of your DMR.

That is about as accurate as you can get. Remember that every browser treats these sorts of redirects differently though. The classic DMR fails miserably on a few of the newer browsers.
 
Setup a page on your own server and put the following code in it:
PHP:
<?php
    echo 'Referer: '.$_SERVER['HTTP_REFERER'];
?>
Use that page as the "end point" of your DMR.

That is about as accurate as you can get. Remember that every browser treats these sorts of redirects differently though. The classic DMR fails miserably on a few of the newer browsers.

Thanks mate,

I'm using the exact DMR described by the OP, are you saying that this DMR may fail with newer browsers even with the redirect to google if the referrer can't be hidden? Or were you referring to other examples of DMR's on the forum?
 
Thanks mate,

I'm using the exact DMR described by the OP, are you saying that this DMR may fail with newer browsers even with the redirect to google if the referrer can't be hidden? Or were you referring to other examples of DMR's on the forum?
No, his code should work fine for browsers that can be DMR'ed and shouldn't leak the referer for those that can't.
 
Hi, knows anybody how can I use DMR with CPA redirector plugin for Wordpress? If I use the meta refresh option in the plugin, I can see still the magic number e.g. mn=ecommerce in my stats and the redirect url, in my case the url of a TE site.

Thanks.
 
I truly believe the best way to redirect is to do a DMR on a secure domain. ie:

youraffiliatelandingpage.com > DMR on https domain > affiliatepage.com

That way you will successfully blank on all major browsers. Browsers that don't support DMR should support blanking via https, and vice versa.

Try it out!

What about newer browsers and https? I mean the FF for example always wants to load a certificate and is warning the user that its not secure and so on... Is there a way to automatically load this certs without spending much money? Otherwise I think a lot visitors will be afraid or suspicious and dont want to go on.

Greetings!
Sebastian
 
Someone has set up DMR for me but it keeps leaking :( Im looking to blank referrer
100%

Please pm me :) I will pay for your help
 
Back
Top