1
IN HTML:
<form method="post" action="../../../consulta.php">
<input type="text" class="form-control" name="login" id="flogin"
placeholder="Insira o seu Login">
<input type="submit" name="send" id="mandar" class="btn btn-success btn-
block" onclick="" value="Entrar">
</form>
IN PHP
if (!empty($_POST)) {
if (isset($_POST['login'])) {
if (!empty($_POST['login'])) {
$filtro = $_POST['login'];
// aqui caso tudo estiver certo
} else {
echo "Por favor, preencha o seu login";
}
} else {
echo "O campo 'login' não existe na variável $_POST";
}
} else {
echo "Não houve submit no formulário";
}
He falls on the last echo
Where does it say there was no Ubmit on the form, where did I go wrong? I’ve tried everything, and it doesn’t show me anything even when I type a number, help me. It’s all inside the body and html tag, the error for some reason is there
Press
F12
and check on the tab Network the request POST; Check if any content arrives usingvar_dump(fgets(STDIN));
– Valdeir Psr
You’re returning me Bool(false), and there’s nothing on F12(Network)
– Froslass
Could you put one more piece of html? I tested your code here and it worked perfectly
– Woton Sampaio
That’s just it, I guess I’ll have to stay here a little while longer to see where the mistake is
– Froslass
You are using Javascript to send the POST?
– Valdeir Psr
Same html form, same form
– Froslass
you are using local server? Which?
– Sam
I think I already found the error, has nothing to do with the codes I put here, the error itself was caused by an if that did not think had to do with the problem
– Froslass