Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

165
Visualizações
Submit form, don't show param and value in URL?

I have a simple form and when the select field is changed it submits the form reloading the current page passing the select value to the page.

<form>
  <select id='query' name='query' onchange='this.form.submit()'>
    <option value=1>1<option>
    <option value=2>2<option>
  </select>
</form>

This works fine, but the URL then contains pagename.php?query=2 Is there anyway to do this without the parameter and value being seen in the URL ?

Thanks

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

When you use form, it has a paramatter that if you dont put nothing, it is METHOD="GET", this makes the petition and sends data from URL, so you should put METHOD="POST":

<form method="post">
  <select id='query' name='query' onchange='this.form.submit()'>
    <option value=1>1<option>
    <option value=2>2<option>
  </select>
</form>

You will have to make some more changes in your php, but i don't have enought information about it to help you.

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda