You are here

function geoip_json_country in GeoIP API 6

Callback handler that returns JSON data of the country.

1 string reference to 'geoip_json_country'
geoip_menu in ./geoip.module
Implementation of hook_menu().

File

./geoip.module, line 93
API for using the MaxMind GeoLite Country database.

Code

function geoip_json_country() {

  // Cast it to a string so that NULLs (which are the result of some lookup
  // failures, like being on a private IP address) will become empty strings.
  // A NULL would result in an empty JSON response, {}, which would prevent the
  // AJAX success callback from firing.
  drupal_json((string) geoip_country_code());
  exit;
}