Need a "Country/State/City" component !

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
tuthmosis
Forum Newbie
Posts: 3
Joined: Sun Nov 04, 2007 9:23 am

Need a "Country/State/City" component !

Post by tuthmosis »

Greetings !

I am looking for a way to know the city where my visitors are... A set of "Country/State/Town" drop-down boxes that updates each other without refreshing the page.

My site is Joomla CMS based.

Either working with drop-down lists of Country/States/Town or by a system of Zooming Maps...

Thanks !
User avatar
Kieran Huggins
DevNet Master
Posts: 3635
Joined: Wed Dec 06, 2006 4:14 pm
Location: Toronto, Canada
Contact:

Post by Kieran Huggins »

Use the Google Maps API to locate a free-form string from your users. It's so much easier for programmer and user alike.

Example:

Code: Select all

Where do you live?
[Toronto, Canada]
tuthmosis
Forum Newbie
Posts: 3
Joined: Sun Nov 04, 2007 9:23 am

Post by tuthmosis »

Kieran Huggins wrote:Use the Google Maps API to locate a free-form string from your users. It's so much easier for programmer and user alike.

Example:

Code: Select all

Where do you live?
[Toronto, Canada]
Any exemples of where it is used ?...
tuthmosis
Forum Newbie
Posts: 3
Joined: Sun Nov 04, 2007 9:23 am

Post by tuthmosis »

tuthmosis wrote:
Kieran Huggins wrote:Use the Google Maps API to locate a free-form string from your users. It's so much easier for programmer and user alike.

Example:

Code: Select all

Where do you live?
[Toronto, Canada]
Any exemples of where it is used ?...
Also, note that my visitors must only specify their town... And i must be able to extract the city name so that it is always identical. (e.g. Montreal and not montréal or montreal... Always "Montreal"... so it can't be a freeFormat text entry.)

Thanks for any help !
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

This thread appears to have no relation to phpclasses.org, therefore doesn't belong there. Moved to PHP-Code.
User avatar
Kieran Huggins
DevNet Master
Posts: 3635
Joined: Wed Dec 06, 2006 4:14 pm
Location: Toronto, Canada
Contact:

Post by Kieran Huggins »

mlemos
Site Admin
Posts: 126
Joined: Mon Apr 29, 2002 4:14 pm
Contact:

Re: Need a "Country/State/City" component !

Post by mlemos »

tuthmosis wrote:Greetings !

I am looking for a way to know the city where my visitors are... A set of "Country/State/Town" drop-down boxes that updates each other without refreshing the page.

My site is Joomla CMS based.

Either working with drop-down lists of Country/States/Town or by a system of Zooming Maps...
I don't know about integrating with Joomla, but you may want to check this forms generation class.

It comes with a plug-in to create multiple linked select inputs. It can be used to retrieve options from the server, eventually from a database, without refreshing the page using AJAX request. Here is an example.

There is also a plug-in that displays a map using Google maps and lets the use pick a location on the map. The plug-in captures the coordinates into text or hidden inputs so they can be passed to the server when the form is submitted. Here is an example.
Post Reply