2016-06-19, 08:32 AM
2016-06-19, 11:10 AM
Most easiest way is to install cloudflare on your site, and just block the country through that
2016-06-21, 01:04 PM
You could use an API to check the country's origin by IP such as http://ip-api.com/json and then hook it to global start and have an array of allowed countries.
You can then check the array by
$allowed = array('gb','us');
if(!in_array($country,$allowed)
{
die('You\'re country is disallowed');
}
This is probably the longest way as CF provide this.
You can then check the array by
$allowed = array('gb','us');
if(!in_array($country,$allowed)
{
die('You\'re country is disallowed');
}
This is probably the longest way as CF provide this.