detect a users province/state

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
assimilation
Forum Newbie
Posts: 3
Joined: Thu May 13, 2010 7:54 pm

detect a users province/state

Post by assimilation »

I'd like to detect what province/state my users are visiting from, so far I can only find ways to detect what country they're from. I know it's possible, does anyone have any solutions for this? Thanks in advance.
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: detect a users province/state

Post by Christopher »

Are you looking for a particular country or anywhere on earth?
(#10850)
assimilation
Forum Newbie
Posts: 3
Joined: Thu May 13, 2010 7:54 pm

Re: detect a users province/state

Post by assimilation »

My question clearly stated that I was looking to detect states/provinces of visitors, so yes I'm looking for a place on earth, not sure what you're getting at.
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: detect a users province/state

Post by requinix »

He's asking whether you only care about tracking users in the US and Canada, or users everywhere on the planet.
assimilation
Forum Newbie
Posts: 3
Joined: Thu May 13, 2010 7:54 pm

Re: detect a users province/state

Post by assimilation »

I want to track provinces in Canada, sorry for the confusion.
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: detect a users province/state

Post by Christopher »

You may be able to do it with a combination of timezone and IP address. And you might use Javascript to find some Geolocation information. Perhaps Google has a service that might do this kind of thing.
(#10850)
Post Reply