Archive

Posts Tagged ‘ip to country’

Finding Location of site visitor

May 26th, 2011 prakash No comments

There are few approaches to find the location of the visitor with their IP. I’ll show you some of the approaches that I know :

  • With including a javascript : This is very useful and trust-worthy method, I’ve seen so far. And is really easy to implement.
    Just Include a file

    wherever you want to display. See below how it displays the result :

    Powered by IP Address Locator

    If you are good at javascript or their libraries, you can change it how you wanted to change.
    Original Source by
    www.ipaddresslocation.org

  • Another method is by using service like :
    http://www.hostip.info/use.html
    Call this URL with REST Method and get the result :

    'http://api.hostip.info/get_html.php?ip='
    

    I, personally don’t recommend to use it, because it has very poor output. May be below 60% accuracy.
    See the result below, how accurately this method is showing your location:


  • For Database approach see the link http://www.maxmind.com/app/geoip_country. You can get Many sites which will provide the database with codes package.