07-25-2014, 05:47 AM
|
|
Confirmed User
Industry Role:
Join Date: Oct 2010
Location: Portugal
Posts: 1,262
|
http://www.ip2location.com/blockvisitorsbycountry.aspx htaccess ips list
https://github.com/MatthewGross/PHP-Country-Block
PHP Code:
$allowed_countries = array("US", "GB", ...);
$country = file_get_contents("http://ipinfo.io/{$_SERVER['REMOTE_ADDR']}/country");
if(!in_array($country, $allowed_countries)) {
// Display an error message, or redirect to another website
}
http://ipinfo.io/developers for more details.
__________________
StagCMS - Adult CMS - user friendly adult content management system - speed up your websites with no SQL connections
ICQ: 63*23*43*113
|
|
|