Sophie

Sophie

distrib > Mageia > 6 > armv5tl > by-pkgid > 0c4a7d3203f7e9f49c301e6a921b05d8 > files > 8

apache-mod_geoip-1.2.10-1.mga6.armv5tl.rpm

To use from PHP, use something like:

GeoIP Country:
<?php
$country_code = apache_note("GEOIP_COUNTRY_CODE");
$country_name = apache_note("GEOIP_COUNTRY_NAME");
?>

GeoIP Region:
<?php
$country_code = apache_note("GEOIP_COUNTRY_CODE");
$region = apache_note("GEOIP_REGION");
?>

GeoIP City:
<?php
$country_code = apache_note("GEOIP_COUNTRY_CODE");
$region = apache_note("GEOIP_REGION");
$city = apache_note("GEOIP_CITY");
?>

==================================================
Redirection with PHP

$country_code = apache_note("GEOIP_COUNTRY_CODE");
  if ( $country_code == "DE" )
  {
  header ("Location: http://www.google.de" );
  }  
  else
  {
  header ("Location: http://www.yoursite.com" );
  }