Forum Moderators: coopster

Message Too Old, No Replies

Get Users Location - IP Address

         

adammc

6:30 am on May 8, 2007 (gmt 0)

10+ Year Member



Hi folks,

Just wondering if its possible to get a visitors country / state based on their IP Address?

I'm looking at displaying relevent news and weather info for each visitor based on their location.

Any advice would be greatly appreciated :)

topr8

7:01 am on May 8, 2007 (gmt 0)

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



yes you can, but you need a database of ip addresses to countries/locations,

i subscribe to a company that is inexpensive that updates the database every month, others are available free/open source.

adammc

7:23 am on May 8, 2007 (gmt 0)

10+ Year Member



How accurate is it?

I have haerd that methods like yours can give you the location of your ISP instead of your actual location, is that right?

topr8

7:47 am on May 8, 2007 (gmt 0)

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



my method is the only way for smaller users, i guess you could calculate it from the location of the last jump or so in a tracert but that would also require quite a sophisticated database too!

there is no way of knowing where an ip address is actually located from the ip address itself, the only way is by buying/obtaining a database that cross references ip addresses with locations.

and it is not 100% accurate, the weak points are:

the database itself - how accurate and current is it
how accurately you trap the ip address of the user, eg are they using proxies and so on.

jatar_k

1:25 pm on May 8, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



try this one
[ip-to-country.webhosting.info...]

all the services now are pretty accurate.

Scally_Ally

2:13 pm on May 8, 2007 (gmt 0)

10+ Year Member



i have used this recently
[linuxjournal.com...]

works pretty well for me, you remotely query using get vars and it returns an array including the country and city (if it can find it)

Ally

[edited by: Scally_Ally at 2:14 pm (utc) on May 8, 2007]

adammc

11:26 pm on May 8, 2007 (gmt 0)

10+ Year Member



thanx guys

Vrindavan

4:46 am on May 28, 2007 (gmt 0)

10+ Year Member



is this useful?

[ip2location.com...]