The GeoIP database uses the following format for Iran's country name :
It'd probably just be easier if you used country codes versus country names, I use country code in all my GeoIP stuff, and haven't noticed any problems with it.
Iran, Islamic Republic of
To modify your GeoIP code to use country_codes instead of country_names is below :
see if that helps. best way to test it is to momentarily block your own country, i.e. if your in the United States, add 'US' in the bad country array and make sure you get redirected. Then of course remove 'US' from the array once you confirm it's working.
include('geoip/geoip.inc'); //this file must exist in your directory
// Uncomment if querying against GeoIP/Lite City.
$gi = geoip_open('geoip/geoip.dat',GEOIP_STANDARD);
// get the ip of the visitor
$addr = getenv('REMOTE_ADDR');
// translate his ip to a country code
$country = geoip_country_code_by_addr($gi, $addr);
// close the geo database
$badcountry = array('IR','CN','RU','SA');
header('Location: http://www.proxlists.com'); //enter a url or page on your site