PHP Code:
<?
$validCountries = array('US', 'CA', '...');
$countryCode = geoip_country_code_by_name($_SERVER['REMOTE_ADDR']);
if(!in_array($countryCode, $validCountries)) {
header('Location: http://www.someplace.com/country_not_aloud');
exit();
}
?>
Real quick down and dirty if you need an example (haven't tested but it should work)... List of country codes available here:
http://www.maxmind.com/app/iso3166