ip2location lite

Populate Country and Region Dropdown Based on Visitor Location

This sample show you a simple solution to tackle a common needs of displaying entire country and region list for visitor selection. It is crucial for many cases such as user registration, feedback gathering page, comment page, billing page and many more. Beyond of just displaying the country and region list, this sample also demonstrate you on how to auto highlight the country and region where the

Calculate distance between 2 IP address

This sample code demonstrates you on how to calculate the distance (in km, miles and nautical miles) for 2 IP addresses. In general, this sample code will retrieve the latitude and longitude from the given IP addresses and perform the distance math calculation. Note: This sample requires the IP2Location BIN database which you can download free at http://lite.ip2location.com

Calculate Sunrise and Sunset Value from IP Address

The example demonstrate you on how to calculate the sunrise and sunset value from IP address, or to be specific - the geolocation from IP address, without the use of weather library. This solution requires a geolocation table, such as the DB11.LITE database which can be downloaded free from lite.ip2location.com. I would like to keep the source code zip small, so, please download it from http:/

How to Block Countries From Accessing Your Website

This sample code demonstrate you on how to block the countries from accessing your website based on visitor's IP address using a non-intrusive method on application level (webpage). I'm using the BIN data file approach that will free my hassle to set up a relation database for this. The IP geolocation BIN data provided in this sample zip is outdated, and you can always download a free IP