Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

find country from which user is browsing?

Status
Not open for further replies.

JamesGMills

Programmer
Aug 15, 2005
157
GB
Hi,

I want to be able to find out what country the user is browsing from. I have tried to download and install a country to IP address database but this is not working.

Maybe there is some sort of browser header you can use or something?

Thanks for help in advance...
 
I use maxmind database (free license), with netblocks in xls format (it is such for download), convert it urself to mysql (I use Access (with mysql odbc connector) for any conversion), and then use it.

This is a link to download proper version and then u'll have to do some conversion to mysql (pay attention at column types, make db with all columns varchar (100) except id column, and then use it in php to check against country origin):

Hope this helped.
 
Ask for any problems occuring. dbertovi@e-tir.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top