MyBB Community Forums

Full Version: Country's allowed / not allowed forums
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
im looking for a plugin where i can block country's that are not allowed on my website, i just want to block a few...
Most easiest way is to install cloudflare on your site, and just block the country through that
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.