Lambda GeoIP - PHP Geo-targeting script
Contact
Contact Lambda GeoIP by AIMevanlambda3
Contact Lambda GeoIP by Gmailevanlambda@gmail.com
Lambda GeoIP is a script to target the physical location of your visitors

Lambda GeoIP is a fully self-hosted geo-targeting script that you can use on your website to determine the geographic location of your visitors. In addition to that, you can determine if a user is on a mobile device, a bot, or using a satellite connection.

You can also forward users to different pages based on their continent, country, region, or city.

All of the features can be used on your site with just 1 line of code in PHP.

Lambda GeoIP does not "phone home", load remote content, or communicate with any other server. It is secure and fully self hosted.

Quantity
IP38.107.179.230
ContinentNA
CountryUnited States
RegionDistrict of Columbia
CityWashington
Postal Code20007
Latitude38.9144
Longitude-77.0763
MobileNo
Satellite CarrierNo
Function List How do I...?
How Do I...?
Buy GeoIP?
Install GeoIP?
Activate a domain?
Forward a user based on location?
Display the location in a particular format?
Display the region if the user is in the United States, and the country otherwise?
Determine if the user is on a mobile device?
Determine if the user is a bot?
Determine if the postal code, ISP, or area code has been detected?
Create complex rules for forwarding?
Function List
function geoip_set_ip($new_ip)
function geoip_format($format)
function geoip_forward_country($country_code, $location)
function geoip_forward_continent($continent_check, $location)
function geoip_forward_region($region, $location)
function geoip_forward_city($city, $location)
function geoip_continent()
function geoip_country()
function geoip_country_code()
function geoip_city()
function geoip_region()
function geoip_postal_code()
function geoip_area_code()
function geoip_latitude()
function geoip_isp()
function geoip_longitude()
function geoip_city_found()
function geoip_region_found()
function geoip_country_found()
function geoip_isp_found()
function geoip_postal_code_found()
function geoip_area_code_found()
function geoip_is_satellite()
function geoip_is_mobile()
function geoip_is_bot()
function geoip_closest_city($format, $population)
How Do I...? Answered
Buy GeoIP?

To buy Lambda GeoIP simply click on the "Buy Now" PayPal logo in the orange box. Once you have paid for the product simply enter your email on the register page to create your account. Once you have an account you can log in and generate the activation codes for new domains.

Install GeoIP?

Once you have purchased Lambda GeoIP and logged in, there is a link to download the script and the database. Download these files to your computer and then upload both of them to the same directory on your website.

Once you have done that, point your browser to the PHP install script you uploaded (ex: www.yourdomain.com/geoip-insta.php). Here you will enter the database details and your activation code for that domain. After you have checked that you have entered the details correctly (there is a built in tool to verify your activation code and database details are correct), click the "install" button. The installer will automatically unzip the database and begin installing it. Since the database is large (unzipped it is a few hundred megabytes) the installer will break it down into smaller jobs. If there are errors during the install, simply press the install button again. If problems persist please contact me at evanlambda@gmail.com.

After the installation has completed successfully, make sure to delete geoip-install.php for security purposes. Now you can simply include the script in your PHP or javascript (ex: require("/myscripts/geoip.php"); in PHP) and you are ready to use Lambda GeoIP.

Activate a domain?

To activate a domain, login and simply enter the domain and press "Generate Code". The code will appear next to the domain below. Note that you will need to use a different code for each subdomain (carl.mydomain.com and fred.subdomain.com will need different codes). Also note that the www portion is ignored so you can usethe same code for www.mysite.com and mysite.com.

Forward a user based on location?

There are special functions in Lambda GeoIP to forward a user based on their location. Take the following script:


<?php
require("geoip.php");

geoip_forward_region("Georgia", "http://mysite.com/georgia.html");
geoip_forward_region("Florida", "http://mysite.com/florida.html");
geoip_forward_country("US", "http://mysite.com/us.html");
geoip_forward("http://mysite.com/everyone-else.html");

?>

This script will look to see if the user is from Georgia first, then Florida, then anyone else in the United States, and then anyone else not in those places will be forwarded to a catch all.

Display the location in a particular format?

The function geoip_format() is your friend. Here is an example if its usage:

echo geoip_format("You are in %city, %region, %country");

Will return:

You are in Chicago, Illinois, United States

For someone living in Chicago. For my variables you can use in the format, look at the function usage.

Display the region if the user is in the United States, and the country otherwise?

<?php
require("geoip.php");

if (geoip_country() == "US") {
echo geoip_format("%city, %region");
} else {
echo geoip_format("%city, %country");
}
?>

Determine if the user is on a mobile device?

<?php
require("geoip.php");

if (geoip_is_mobile()) {
echo "User is on a mobile device";
} else {
echo "User is not on a mobile device";
}
?>

Determine if the user is a bot?

<?php
require("geoip.php");

if (geoip_is_bot()) {
echo "User is a Bot";
} else {
echo "User is not a Bot";
}
?>

Determine if the postal code, ISP, or area code has been detected?

<?php
require("geoip.php");

if (geoip_postal_code_found()) {
echo "Postal code found";
} if (geoip_isp_found()) {
echo "ISP found";
} if (geoip_area_code_found()) {
echo "Area code found";
}
?>

Create complex rules for forwarding?

You can be as creative as you want with forwarding. Here is an example that forwards a user based on what hemisphere they are in:

<?php
require("geoip.php");

if (geoip_latitude() > 0) {
geoip_forward("mysite.com/northern-hemisphere.html");
} else {
geoip_forward("mysite.com/southern-hemisphere.html");
}
?>

Functions
function geoip_set_ip Manually set the IP Address for geo targetting. (Note that the user's IP Address is automatically detected by Lambda GeoIP. Setting the IP manually can be useful in special circumstances)
function geoip_format($format) Print the user's geo information in the following format. The following strings within the format will be replaced with their value:

%code - The user's country code (Ex: US for United States)
%country - The full name of the user's country
%region - The user's region (Ex: California or Quebec)
%city - The user's city
%lat - The latitude of the user's city
%long - The longitude of the user's city
%postal - The postal code for the user's area
%areacode - The area code for the user's area (United States Only)
%isp - The user's ISP
function geoip_forward_country($country_code, $location)
Forward a user to a given address based on their country. (Note: This is based on the country code, not the full name of the country)
function geoip_forward_continent($continent_check, $location)
Forward a user to a given address based on their continent. (NA - North America, SA - South America, AS - Asia, AF - Africa, EU - Europe, OC - Australia and Oceania)
function geoip_forward_region($region, $location)
Forward a user to a given address based on their region. (This is based on the full region name, Ex: Oregon)
function geoip_forward_city($city, $location)
Forward a user to a given address based on their city.
function geoip_continent()
Returns the user's continent code.
function geoip_country()
Returns the full name of the user's country.
function geoip_country_code()
Returns the user's country code.
function geoip_city()
Returns the user's city. (Blank if not found)
function geoip_region()
Returns the user's region. (Blank if not found)
function geoip_postal_code()
Returns the user's postal code. (Blank if not found)
function geoip_area_code()
Returns the user's area code. (Blank if not found)
function geoip_latitude()
Returns the user's city's latitude.
function geoip_isp()
Returns the user's ISP.
function geoip_longitude()
Returns the user's city's longitude.
function geoip_city_found()
Returns true if the city was detected, false if not.
function geoip_region_found()
Returns true if the region was detected, false if not.
function geoip_country_found()
Returns true if the country was detected, false if not.
function geoip_isp_found()
Returns true if the user's ISP was detected, false if not.
function geoip_postal_code_found()
Returns true if the postal code was detected, false if not.
function geoip_area_code_found()
Returns true if the area code was found, false if not.
function geoip_is_satellite()
Returns true if the user is using a satellite based ISP, false if not.
function geoip_is_mobile()
Returns true if the user is on a mobile device, false if not.
function geoip_is_bot()
Returns true if the user identifies itself as a bot, false if not.
function geoip_closest_city($format, $population)
Returns the closest city (In the format specified) of a given population. The following variables in the format are replaced with the appropriate values:

%code - The user's country code (Ex: US for United States)
%country - The full name of the user's country
%region - The user's region (Ex: California or Quebec)
%city - The user's city
%lat - The latitude of the user's city
%long - The longitude of the user's city
%lat - The latitude of the user's city
%long - The longitude of the user's city
%distance - The approximate distance (in miles) of the closest city from the detected city
Embroidered Shirts