Hi, I have a customer who wants to block anyone accessing his site from Czech Republic. How would i go about doing this? Cheers, Adam
$array = array("All of the ips..."); foreach ($array as $ip) { if ($_SERVER['REMOTE_ADDR'] == $ip) { die("Error..."); } Code (markup):
You can create a .htaccess with the following content: Order Allow,Deny Deny from 69.28 Allow from all Code (markup): This will block any IP in the range of 69.28.*.*
<?php if(geoip_country_code_by_name($_SERVER['REMOTE_ADDR'])=="cz"){ echo "This country is banned!"; die; } ?>