Home / Tutorials / Find Geo Location By IP Address using maxmind GeoLiteCity Database
geo location

Find Geo Location By IP Address using maxmind GeoLiteCity Database

There several ways to find geo location like address, city, country, latitude, longitude, area etc.  Here I’m going to show you how we can get geo location by IP address using www.maxmind.com’s GeoLiteCity database.

1. Download GeoIP Class file: geoip.inc – http://www.maxmind.com/download/geoip/api/php-20120410/geoip.inc
2. Download GeoIpCity Class file: geoipcity.inc – http://www.maxmind.com/download/geoip/api/php-20120410/geoipcity.inc
3. Download GeoIpRegionVars Class file: geoipregionvars.php – http://www.maxmind.com/download/geoip/api/php-20120410/geoipregionvars.php
4. Download GeoLiteCity database fie: GeoLiteCity.dat – http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz

NOTE: Please convert GeoLiteCity.dat.gz to GeoLiteCity.dat and put all these files in geoip named folder

Geo Location By IP Address

Now lets create main working file to get geo location using ip address.

In above code I used function getRealUserIp() . Here is this function to get real ip address of visitor and this ip address will be used to get geo location of visitor.

 

About cmadmin

Web Developer & Designer | Android App Developer

Leave a Reply

Your email address will not be published. Required fields are marked *

Login


Username
Create an Account!
Password
Forgot Password? (close)

Sign Up


Username
Email
Password
Confirm Password
Want to Login? (close)

Forget Password?


Username or Email
(close)
%d bloggers like this:
SHARE
OR
SUBSCRIBE
To get latest new / tutorial / technology / development information subscribe with us.
ARE YOU READY? GET IT NOW!
Lets Get Updated with latest trends & tutorials!
Your Information will never be shared with any third party.
Ready for latest tutorials & tools !
OR SUBSCRIBE WITH