geoip.inc

Summary
geoip.inc
DescriptionThis file holds all original functions from maxmind.
GeoIP-Functions
geoip_country_code_by_addrFetches country-code
geoip_country_name_by_addrFetches country-name

Description

This file holds all original functions from maxmind.  But in fact, we need only two of them.

It is automatically included from geoip_functions.php.

GeoIP-Functions

geoip_country_code_by_addr

function geoip_country_code_by_addr($gi,
$addr)

Fetches country-code

Prototype

string geoip_country_code_by_addr( handle $gi, string $ip_addr )

Parameters

gi(handle) The handle returned from geoip_open_db().
ip_addrstring A IP-Address.

Returns

country-code, e.g.  "US", or empty string if ip is from bogons space (private, reserved, local).

geoip_country_name_by_addr

function geoip_country_name_by_addr($gi,
$addr)

Fetches country-name

Prototype

string geoip_country_name_by_addr( handle $gi, string $ip_addr )

Parameters

gi(handle) The handle returned from geoip_open_db().
ip_addrstring A IP-Address.

Returns

country-name, e.g.  "Brazil", or empty string if ip is from bogons space (private, reserved, local).

function geoip_country_code_by_addr($gi,
$addr)
Fetches country-code
function geoip_country_name_by_addr($gi,
$addr)
Fetches country-name
Close