Geo redirect code

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Freedoom
    Confirmed User
    • Feb 2006
    • 2811

    #1

    Geo redirect code

    Hi,

    I have this code to redirect traffic :

    Code:
    <?PHP
    include('/home/domain/public_html/geoip/geoip.inc'); //this file must exist in your directory
     
    $gi = geoip_open('/home/domain/public_html/geoip/GeoIP.dat',GEOIP_STANDARD);
     
    // get the ip of the visitor
    $addr = getenv('REMOTE_ADDR');
    // translate his ip to a country code
    $country = geoip_country_code_by_addr($gi, $addr);
    // close the geo database
    geoip_close($gi);
     
    $badcountry = array('TR','IN','ID',"PK","CN",'MY');
    // You can change the example with any countries that you want to block
     
    // redirect them if they suck
    if(in_array($country, $badcountry))
    header('Location: http://www.domain.com/'); //enter a url or page on your site
    ?>
    How can I redirect the "good" traffic(all the countries that aren't in the bad country array) to other url?

    Thanks
    List Of Sex Cams
  • CPA-Rush
    small trip to underworld
    • Mar 2012
    • 4927

    #2
    header('Location: http://bye.com');
    }
    else
    {
    header('Location: http://welcome.com');
    }
    ?>

    automatic exchange - paxum , bitcoin,pm, payza

    . daizzzy signbucks caution will black-hat black-hat your traffic

    ignored forever :zuzana designs

    Comment

    Working...