Several cities in one project

Asked

Viewed 51 times

1

Good Afternoon!

I wanted some tips.

I am developing a project of a classified site, I want to use it with several cities here in the region, as I can do so that on the same site the user select his city?

For example, the user selects São Paulo the site directs to the classifieds of São Paulo. Rio de Janeiro the same thing, etc...

What they tell me?

Thank you!

  • Any specific question?

  • How to separate this in a database?

  • Basically a table with municipalities and a field id_municipio (example) in the advertisement table

1 answer

0

There are several ways to do this, you can do with url’s friendliness by passing the direct city parameter in the url, example:

www.meusite.com.br/saopaulo www.meusite.com.br/riodejaneiro

you can do via the javascript onchange event, by selecting the city in a list (select html) it redirects to the chosen city.

via AJAX and then you wouldn’t even need to reload the page, just select the city and already update the content in the container you specify.

  • But how to separate it in the comic book?

  • Create a city table, and in the rating table relate the city ID to the ad.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.