Skip to content

Instantly share code, notes, and snippets.

@dangrossman
Created March 15, 2013 04:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dangrossman/5167541 to your computer and use it in GitHub Desktop.
Save dangrossman/5167541 to your computer and use it in GitHub Desktop.
include("geoipcity.inc");
include("geoipregionvars.php");
$gi = geoip_open("GeoLite.dat", GEOIP_STANDARD);
$record = geoip_record_by_addr($gi, $_SERVER['REMOTE_ADDR']);
if ($record->country_code == 'US') {
header("Location: http://us-offer-url");
} else if ($record->country_code == 'UK') {
header("Location: http://uk-offer-url");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment