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

Need some cloaking help here - Expert Needed

Discussion in 'Cloaking and Content Generators' started by pasenseoso, Apr 21, 2012.

  1. pasenseoso

    pasenseoso Power Member

    Joined:
    Aug 19, 2011
    Messages:
    750
    Likes Received:
    135
    Occupation:
    hachetman
    Location:
    - - P I L I P I N A S - -
    Home Page:
    I got some cloaking code and it works perfectly with firefox. But, it does not work on google chrome. Can somebody help me fix this code??? I'm doing double meta refresh.

    first php file :
    Code:
    <?php
    echo "<meta http-equiv=\"refresh\" content=\"0;url=offer.php\">";
    ?>
    

    second php file (saved as offer.php) :

    Code:
    <?php
    $sites = array_map("trim", file("offer.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\">";  
    }
    ?>
    


    and got a text file with the links to get redirected randomly.

    Here's what it do :

    1. redirect to the links in the offer.txt file (random)

    2. it does work on firefox

    3. DOES NOT work in Google Chrome.

    Does anyone have a solution for this???


    -drey
     
  2. pasenseoso

    pasenseoso Power Member

    Joined:
    Aug 19, 2011
    Messages:
    750
    Likes Received:
    135
    Occupation:
    hachetman
    Location:
    - - P I L I P I N A S - -
    Home Page:
    anyone???
     
  3. roster67

    roster67 Registered Member

    Joined:
    Mar 27, 2012
    Messages:
    69
    Likes Received:
    10
    Certainly your problem is caused by a bug concerning the referer
    $_SERVER['HTTP_REFERER'].

    There is a well known issue concerning this bug in Chrome, see issue id=1935 on code google. {srry cannot post link}​

    Check the value of $referer if its the same under all browers.
    If not, you could try something like this:

    Code:
    <?php
    [B]$_SESSION["referer"] = $_SERVER['HTTP_REFERER'];[/B]
    echo "<meta http-equiv=\"refresh\" content=\"0;url=offer.php\">";?>
    
    Code:
    <?php
    $sites = array_map("trim", file("offer.txt"));
    $redirect = $sites[array_rand($sites)];
    [B]$referer = $_SESSION["referer"];$_SESSION["referer"] = "";[/B]  
    if($referer == "")
    echo "<meta http-equiv=\"refresh\"content=\"0;url=hxxp...".$redirect."\">"; 
    else{
    echo "<meta http-equiv=\"refresh\" content=\"0;url=LINKTOGOOGLE">";  }
    ?>
    
     
    • Thanks Thanks x 2
  4. pasenseoso

    pasenseoso Power Member

    Joined:
    Aug 19, 2011
    Messages:
    750
    Likes Received:
    135
    Occupation:
    hachetman
    Location:
    - - P I L I P I N A S - -
    Home Page:
    thanked and rep'd. :) works smooth.. :)