Forum Moderators: coopster

Message Too Old, No Replies

finding which country the user is from

         

jackvull

4:58 pm on Jan 3, 2006 (gmt 0)

10+ Year Member



I have seen many sites where they 'guess' the country you are from, presumably from your IP address, and then display this somewhere on the page, or indeed to determine which language to display the page in.

Is there a central location anywhere which lists the IP addresses that a country starts with?

topr8

5:04 pm on Jan 3, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



you normally would download a list - which needs to be updated regularily - which matches ip's to countries. you then insert it to your own db and do the appropriate check in your code.

we pay for a list from someone called ip2location and i've been very happy with them.

i believe there are free lists available too

inbound

5:17 pm on Jan 3, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



MaxMInd have a free IP list (which they state is 97% accurate, but has all AOL users as US)

They also offer various commercial alternatives, either API or download.

Be aware that none of the location systems are 100% accurate (or possibly even 99%), but they are useful in certain circumstances.

If you are dealing with US traffic then it's much better for location from IP than the UK for example.

Also, MaxMind show you how to construct MySQL queries for the free download.

jatar_k

6:32 pm on Jan 3, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



I've used these guys ever since they were listed on php.net

[ip-to-country.webhosting.info...]