Yes, it's odd, here I am using Verizon FIOS (for the past 4 years) and
most any place on the web I go to knows I'm in the US, but the Google
JSAPI and examples by others using it I have tried say I'm in Canada.
(For those that don't think this is a real issue - Canada is like a
whole other country. :-) )
I've also looked into IP databases where they have over 3 billion IP
addresses stored and they update them. They suggest to keep them on
your own server and do a wget in the crontab to update them monthly.
I'm kind of surprised by this because I thought IP address ranges were
assigned to countries to began with, but I'm sure that's a whole other
discussion.
I wasn't familiar with the maxmind javascript service. So far it looks
very good, it correctly said I was in the US and even the correct
state. Thanks!
David Roth
Rob Marscher rmarscher at beaffinitive.com
Tue May 31 09:49:00 EDT 2011
>
> On May 30, 2011, at 2:42 AM, David Roth wrote:
> What I'm trying to do is get the county code of the user so that
different
> links can be presented to them that matches their country. Serving
up
> different links based on the country code would be handled by
Javascript.
>
I'm not sure why the google library is saying you're in Canada.
MaxMind
provides a javascript api you can add to your page to get the
visitor's
location from his/her ip address: http://www.maxmind.com/app/javascript_city
_______________________________________________
New York PHP Users Group Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk
http://www.nyphp.org/Show-Participation