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

93
Visualizações
Reload does not change POST state

I have a problem where I want to reload the page on submit. I did this with the simple script function shown below. However, the echo'd "hello" does not disappear when I reload. Is there a reload function that changes the state of my submit post, and the "hello" is no longer appearing.

<!DOCTYPE html>
<html lang="en">
<body>
<form method="post">
    <button class="btn-login" type="submit" name="submit">Sign in</button>
</form>

<?php
if (isset($_POST['submit'])) {
    echo "hello";
    echo "<script>window.location.reload(true)<script>";
}
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

If you want to redirect to a new page (or even the same page) but without POST values, then use

window.location.replace(url)

https://developer.mozilla.org/en-US/docs/Web/API/Location/replace

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