~ubuntu-branches/ubuntu/wily/libapache2-mod-geoip/wily-proposed

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
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" );
  }