1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Is a PHP redirect as effective as a double meta refresh?

Discussion in 'Cloaking and Content Generators' started by droppin loads, Nov 16, 2008.

  1. droppin loads

    droppin loads Newbie

    Joined:
    Jan 2, 2009
    Messages:
    1
    Likes Received:
    0
    If I put a PHP redirect through another domain, is it as effective as a DMR?

    Will the referrer still be blank and is there any chance of retracing back to the original domain? Comments appreciated.
     
  2. aftershock2020

    aftershock2020 Senior Member

    Joined:
    Oct 19, 2007
    Messages:
    981
    Likes Received:
    477
    It works on the same principle as a meta redirect. The key is in coding the php for a cloaked redirect and then for an ' if ' statement to return the site to a default page or the same page you redirected to in a loop so that if the user should try to track back to the source, it would only take them to the directed pages you send them to within that loop.

    A meta redirect is a fail-safe or default redirect and since it is visible in the html by view source, unlike the php method, I'd highly recommend the php across the board.

    It's completely open to opinion and preference though.

     
  3. droppin loads

    droppin loads Newbie

    Joined:
    Jan 2, 2009
    Messages:
    1
    Likes Received:
    0
    Thanks for input, I fully understand what you mean about not allowing the user to click the back button (i.e. trapping the person in your site lol). I need to get on that!

    + rep
     
  4. droppin loads

    droppin loads Newbie

    Joined:
    Jan 2, 2009
    Messages:
    1
    Likes Received:
    0
    Actually does anyone know the code for a redirect loop?

    I can do a simple PHP redirect, but the loop part I'm not so sure of.

    Any help would be greatly appreciated :)
     
  5. drkenneth

    drkenneth Executive VIP

    Joined:
    Nov 13, 2008
    Messages:
    285
    Likes Received:
    176
    Occupation:
    Developer/Entrepreneur
    Location:
    USA
    A php redirect, in general, will NOT mask the referer.
    Summary of referer behavior:
    PHP Redirect: referer will be where the user came from to get to the redirect page
    Meta Refresh: referer will be blank (usually)
    Javascript Redirect: referer will be the redirect page

    If you want to blank the referer most of the time, use a meta refresh.
    If you want to blank the referer EVERY time, use a double meta refresh (making sure it was blank via php)
     
  6. droppin loads

    droppin loads Newbie

    Joined:
    Jan 2, 2009
    Messages:
    1
    Likes Received:
    0
    thanks for that.

    Can I have two DMRs (each inside a php script) within the same domain?

    So essentially:
    Ad->DMR1.php->DMR2.php->merchant
    DMR 1 and 2 would be on the same domain? Would this work?
     
  7. drkenneth

    drkenneth Executive VIP

    Joined:
    Nov 13, 2008
    Messages:
    285
    Likes Received:
    176
    Occupation:
    Developer/Entrepreneur
    Location:
    USA
    Here is the code for the type of php double meta refresh I do--only requires 1 page. (You can name it whatever you want--it looks itself up for the first bounce.)

    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>
    
    Enjoy! Hope this helps :)

    What you said would work fine--but I find this way very elegant ;-)
     
    • Thanks Thanks x 13
    Last edited: Nov 18, 2008
  8. droppin loads

    droppin loads Newbie

    Joined:
    Jan 2, 2009
    Messages:
    1
    Likes Received:
    0
    Thank you sir, awesome post once again. Another +rep
     
  9. droppin loads

    droppin loads Newbie

    Joined:
    Jan 2, 2009
    Messages:
    1
    Likes Received:
    0
    So for the referer.php content, would I just use a simple php redirect? I assume that redirect.php would only get executed when the referrer is blank (I'm horrible at reading PHP code but this is what I am interpreting so please bear with me :) )
     
  10. drkenneth

    drkenneth Executive VIP

    Joined:
    Nov 13, 2008
    Messages:
    285
    Likes Received:
    176
    Occupation:
    Developer/Entrepreneur
    Location:
    USA
    That code is posted if for the FULL redirect structure. No other redirects needed. :)

    Basically works like this:
    -You link user to that page from anywhere you want
    -The page meta refreshes back to itself + the argument ?S=1 appended on the end of the link
    -On the reload, the page says "Hey this is their second view (since S=1, as opposed to nothing)--is their referer cleared?" and if it is cleared shoots them off to your affiliate, if not it dumps them to google.
     
  11. droppin loads

    droppin loads Newbie

    Joined:
    Jan 2, 2009
    Messages:
    1
    Likes Received:
    0
    Hey Kenneth, I really appreciate you taking the time to walk through your stuff with a dummy like me :)

    That was my understanding as well (your above post). When I put in a URL directly as below, I get an error (the URL btw has been modified so it would be garbage if you clicked on it, but just used as an example of the link format):

    //Landing page
    $bounce_loc='http://nbjmp.com/click/?s=32234&c=90345';

    If I put in a php redirect as below it works:
    //Landing page
    $bounce_loc='landingpage.php';

    Any reason why this would be happening? Should I just include the php redirect?
     
  12. drkenneth

    drkenneth Executive VIP

    Joined:
    Nov 13, 2008
    Messages:
    285
    Likes Received:
    176
    Occupation:
    Developer/Entrepreneur
    Location:
    USA
    What error are you getting?

    What do you mean by "just include the php redirect"?
     
  13. droppin loads

    droppin loads Newbie

    Joined:
    Jan 2, 2009
    Messages:
    1
    Likes Received:
    0
    The browser just displays ");?>

    I assume it doesn't like the print command for some reason but I haven't modified it at all. I only added in a URL to the first bounce variable.

    Are there some "/" missing from the above code? I think forums sometimes screw up the display of code. Thanks man
     
    Last edited by a moderator: Nov 20, 2008
  14. droppin loads

    droppin loads Newbie

    Joined:
    Jan 2, 2009
    Messages:
    1
    Likes Received:
    0
    sorry dude it's working now. Something fucked up with my html editor that screwed up the code somehow.

    Anyways thanks alot man, appreaciate all your help!
     
  15. mimosa

    mimosa Newbie

    Joined:
    Aug 2, 2008
    Messages:
    1
    Likes Received:
    0
    I have not thought that there will be a problem with php redirect. Thanks for the info.
     
  16. umxid

    umxid Newbie

    Joined:
    Aug 26, 2009
    Messages:
    3
    Likes Received:
    0
    Hello drkenneth, may you clear one detail cause i still cant get. Should we replace "referer.php" in //Landing page$bounce_loc='referer.php'; with our affiliate link, or? Anyway when i do replace it with my own link i get 403 error
     
  17. drkenneth

    drkenneth Executive VIP

    Joined:
    Nov 13, 2008
    Messages:
    285
    Likes Received:
    176
    Occupation:
    Developer/Entrepreneur
    Location:
    USA
    Replace it with the absolute path to the affiliate link, e.g. "http://www.affiliatesite.com?id=23112" I believe the problem is you're leaving out the http:// and so it is trying a relative path (on your site) as opposed to a absolute path.
     
  18. haylander

    haylander Registered Member

    Joined:
    May 24, 2009
    Messages:
    54
    Likes Received:
    20
    thanks drkenneth for the script , i'm no expert at double meta refresh , so i have a few qustions to ask
    how can the meta (referer) be not cleared after refreshing the page ?
    and is there any other command than $_SERVER['HTTP_REFERER'] the network can extract informations about the previous page ?
     
  19. drkenneth

    drkenneth Executive VIP

    Joined:
    Nov 13, 2008
    Messages:
    285
    Likes Received:
    176
    Occupation:
    Developer/Entrepreneur
    Location:
    USA
    Some browsers simply don't clear the referer on a meta refresh. One leak can give you up, so it's better to be safe and check to make sure the browser you're dealing with is capable of clearing the referer before sending them to the destination.

    The referer (i.e. $_SERVER['HTTP_REFERER']) is the only identifying information sent about previous pages.
     
  20. betster77

    betster77 Regular Member

    Joined:
    Mar 21, 2009
    Messages:
    246
    Likes Received:
    237
    True. Opera leaks DMR I recently found in some tests. Better check on a gateway third page to be 100%.