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.
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.
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.
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.
The function geoip_format() is your friend. Here is an example if its usage:
echo geoip_format("You are in %city, %region, %country");For someone living in Chicago. For my variables you can use in the format, look at the function usage.
<?php
require("geoip.php");
if (geoip_country() == "US") {
echo geoip_format("%city, %region");
} else {
echo geoip_format("%city, %country");
}
?>
<?php
require("geoip.php");
if (geoip_is_mobile()) {
echo "User is on a mobile device";
} else {
echo "User is not on a mobile device";
}
?>
<?php
require("geoip.php");
if (geoip_is_bot()) {
echo "User is a Bot";
} else {
echo "User is not a Bot";
}
?>
<?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";
}
?>
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");
}
?>