Randomized DMR

Discussion in 'PHP & Perl' started by MrDetails, Apr 13, 2010.

  1. MrDetails

    MrDetails Regular Member

    Nov 16, 2009
    Likes Received:
    I've been using this for a while now to rotate offers while blanking the ref, but it seems to prefer going to 1 url over the rest (not by much but it's noticeable in tests). Basically all I wanted to know is if this is the best way of going about doing this, or if there are better, more reliable ones out there.

    Anyway, here's the code I've been using. (I didn't make this, I just got it from an old eBook I bought.)

    "LINK #1"
    $page2 "LINK #2"
    $page3 "LINK #3";  
    $referer $_SERVER['HTTP_REFERER']; 
    $mypages = array($page1$page2$page3); 
    $myrandompage $mypages[mt_rand(0count($mypages) -1)]; 
    $referer == ""

    { echo 
    "<meta http-equiv=\"refresh\" content=\"0;url=$myrandompage\">"; } 

    else { echo 
    "<meta http-equiv=\"refresh\" content=\"0;url=index.php\">"; } 

    All suggestions are appreciated :)