View Single Post
Old 07-25-2014, 05:47 AM  
MrGusMuller
Confirmed User
 
MrGusMuller's Avatar
 
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

MrGusMuller is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote