I donβt know any plugins that have exactly what you need, but if I personally created it, I first looked at this information when filling out the database with all the information for each city.
Information will be organized as follows:
--------------------------------------------------------------------------------- | Country | State | Province | City | Latitude | Longitude | ---------------------------------------------------------------------------------
and each city is its own row in the database. Latitude and longitude will be optional, but recommended.
After that, it would be useful to use AJAX to populate drop-down lists on the fly. Basically, you can use jQuery (recommended for this task, since we donβt want to reinvent the wheel) to send a GET or POST request to a separate PHP script. This file will run the SQL query (be sure to avoid the mysql_ * functions as they are deprecated. See PDO for a better alternative) and check the values ββthat are passed to it in the database.
I would recommend populating your database with some basic information. Perhaps set it up for several states and cities, and then study the resources that I gave you to get a working proof of the concept.
If you run into any stumbling blocks, feel free to open another question so that we can help you.
Good luck.
source share