0
This is my select, for a long time I try to use more do not know how it works, I see that many large sites use and the user select the city it shows the respective content, but the URL does not change.
<form action="cid.php" method="get">
<select name="cidade" id="cidade">
<option>Selecione</option>
<option value="Cidade 1">Cidade 1</option>
<option value="Cidade 2">Cidade 2</option>
<option value="Cidade 3">Cidade 3</option>
</select>
<input type="submit" name="submit" id="submit" class="botao" value="Ok">
</form>
Anyone who can help or give me direction I thank you very much.
Are you sure the URL does not change? By pressing the button OK the URL should be something like
cid.php?cidade=Cidade%201
. Some current browsers omit to query string by default URL, so you already tried to recover the value in PHP with$_GET
?– Woss
It shows "City=City+1&Ubmit=Ok", I wanted to know how to get him to the page of the given city.
– José Firmino
And what page would that be?
– Woss
The site is telecom, each city has a value, ai would be type: city 1 = page 1. As it is done on this site and many others: http://www.evonetworks.com.br/cid.php | https://www.brisanet.com.br
– José Firmino
How would I make the user’s choice stick even if he changes pages? Let’s say the user accessed the site and chose your city, but after switching pages on the same site, the choice remains. I did as mentioned above and it worked, however, when the user navigates to other pages, it gets lost.
– Ederson Luiz Gobbi