2
Hello,
I am creating a site with login system in php, and I have the following problem,
When I enter Login it does not check in the database if the information exists.
I wish I knew what mistake I’m making.
Follows the Code:
<p>
<label for="email">E-mail:</label><br>
<input required type="text" id="email" name="email" size="35">
</p>
<p>
<label for="senha">Senha:</label><br>
<input type="password" id="senha" name="senha" required>
</p>
<input type="submit" value="enviar" name="enviar">
if( empty($_POST["email"]) || empty($_POST["senha"]) ){
echo "Digite o Login";
}else {
$email = $_POST['email'];
$senha = $_POST['senha'];
// Verificando se o usuário/e-mail existe no sistema
$usuarios = buscaUsuario($conexao, $email);
// Processo de login
if( password_verify($senha, $usuarios['senha']) ){
entrar($usuarios['id'],$usuarios['email'],$usuarios['senha']);
header("location:posts.php");
} else {
echo "Login não encontrado";
}
}
}
I could describe more exactly what it would be "it does not check in the database if the information exists"? Already debugged the code to check if the data received in PHP are correct and in which
if/else
is passing by?– Costamilam
I’m not sure, but if I’m not mistaken, it will only work if the
inputs
are inside aform
with aaction=
preparing for a PHP and specifying themethod="Post"
in your case...– Jakson Fischer