You are here

function smart_ip_get_abstract_url in Smart IP 7.2

Same name and namespace in other branches
  1. 6.2 smart_ip.module \smart_ip_get_abstract_url()

Get Abstract IP Geolocation URL

Parameters

String $abstract_key Abstract unique API key:

String $ip_adress IP address to geolocate:

Interger $version Version number of Abstract IP Geolocation service to use:

1 call to smart_ip_get_abstract_url()
smart_ip_get_location in ./smart_ip.module
Get the geo location from the IP address

File

./smart_ip.module, line 1361
Determines country, geo location (longitude/latitude), region, city and postal code of the user, based on IP address

Code

function smart_ip_get_abstract_url($abstract_key, $ip_address, $version = 1) {
  if ($version == 1) {

    // Version 1
    return "https://ipgeolocation.abstractapi.com/v1/?api_key={$abstract_key}&ip_address={$ip_address}";
  }
}