Most of the websites serve the same content to all of their visitors, but… serving personalized content to the visitor makes difference from other sites.
There are many ways to do it, in this article we will see how to obtain visitor geographical location, once we know where the visitor is from… then we can display dynamic content based on it!.
We will use “freegeoip.net” API to get the geographical location of the visitor based on the IP address, freegeoip.net offers a public RESTful web service for searching geolocation of IP addresses and host names.
http://freegeoip.net/{format}/{ip_or_hostname}
{format}
output format “csv” or “xml” or “json”
{ip_or_hostname}
ip or hostname
Request
http://freegeoip.net/json/google.com
Response
{"city": "Mountain View", "region_code": "CA", "longitude": "-122.057", "region_name": "California", "country_code": "US", "latitude": "37.4192", "country_name": "United States", "ip": "173.194.77.113", "zipcode": "94043", "metrocode": "807"}
function geolocationfromip() {
$m_strUrl = "http://freegeoip.net/json/".$_SERVER['REMOTE_ADDR'];
$m_arrGeo = json_decode(file_get_contents($url), true);
return $m_arrGeo;
}
PhoneGap is an open-source mobile development framework which enables software programmers to build applications for mobile devices using JavaScript, HTML5 and CSS3, instead of lower-level languages such as Objective-C. The resulting applications are hybrid, meaning that they are neither truly native nor purely web based.

The mobile framework allows web developers to natively target all smartphones with a single codebase (JavaScript, HTML and CSS) by enabling a Foreign Function Interface (FFI) to an embedded WebView or Webkit on the device. PhoneGap currently supports development for the below operating systems
![]()

Started Android development…! thought of catching up with the green guy as android is steadily conquering the smartphone market.
Goolge App Inventor IDE helped a lot… to start with the app development without knowing any basic knowledge of the SDK/API’s, I had evaluated many… but this was faster and straight forward for the job which we have in hand!