View Single Post
Old 09-30-2010, 10:36 AM  
BestXXXPorn
Confirmed User
 
BestXXXPorn's Avatar
 
Join Date: Jun 2009
Location: Asheville, NC
Posts: 2,277
PHP Code:
<?
    $validCountries = array('US', 'CA', '...');
    $countryCode    = geoip_country_code_by_name($_SERVER['REMOTE_ADDR']);
    
    if(!in_array($countryCode, $validCountries)) {
        header('Location: http://www.someplace.com/country_not_aloud');
        exit();
    }
?>
Real quick down and dirty if you need an example (haven't tested but it should work)... List of country codes available here: http://www.maxmind.com/app/iso3166
__________________
ICQ: 258-202-811 | Email: eric{at}bestxxxporn.com
BestXXXPorn is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote