Page 1 of 1
Display User's City/State on Page
Posted: Thu Feb 05, 2009 8:06 pm
by Priceless1
How do I do this in text?
"You are located in San Diego, California."
I have searched many sites and found GEO IP but nothing that either does not cost money or can just show city & state.
Re: Display User's City/State on Page
Posted: Thu Feb 05, 2009 8:12 pm
by John Cartwright
After 30 seconds of searching..
http://www.maxmind.com/app/php
Code: Select all
Pure PHP module
Download pure PHP module. Free GeoLite Country and GeoLite City databases are available.
Re: Display User's City/State on Page
Posted: Thu Feb 05, 2009 8:27 pm
by Priceless1
It links to this
http://geolite.maxmind.com/download/geoip/api/php/
and says download PURE PHP model. I see no file named that...
What do I do with these files?
Re: Display User's City/State on Page
Posted: Thu Feb 05, 2009 8:47 pm
by John Cartwright
You need to download the .dat file which contains the geoip information (found
here)
Then simply take a look at the examples in the link you provided.. they are pretty self explanatory.
If you are having troubles post some specific questions with what you have tried.
Re: Display User's City/State on Page
Posted: Thu Feb 05, 2009 9:05 pm
by Priceless1
I am new to PHP and would simply like you to tell me what to do with this GeoLiteCity.dat file. It is borderline 18 MBs and I am attempting to import it into PHPMYADMIN under a MYSQL database but it seems like the wrong way to doit...
Re: Display User's City/State on Page
Posted: Thu Feb 05, 2009 9:08 pm
by Priceless1
"Download pure PHP module. Free GeoLite Country and GeoLite City databases are available.
A port to PHP5 of the PHP API is available from PEAR.
The Pure PHP API is cross-platform, works on Windows as well as Linux, and does not require Apache, nor does it require the C API"
So is the PHP module separate from the Free Geolite Country and City Database/ .dat file download? If so - where is that PHP module?
Do I need the PEAR port?
Re: Display User's City/State on Page
Posted: Thu Feb 05, 2009 9:21 pm
by John Cartwright
the .dat file is a self contained data file. You do not need to import it anywhere. Simply upload it to your server and reference as the example files show.
No point on showing you how to do it when their own examples do
http://geolite.maxmind.com/download/geo ... e_city.php
http://geolite.maxmind.com/download/geo ... le_org.php