I am having a problem with an inventory system I am programming; The problem is that the login does not want to work, it does not enter the system no matter how much I enter the data, the message always appears that the data is incorrect And I don’t know what to do anymore, I have looked for all possible solutions and I still can’t solve it, and I need to finish this system because it is my thesis for the university, please help me. This is the code:
=APP_NAME;?>
/public/plugins/fontawesome-free/css/all.min.css">
/public/plugins/icheck-bootstrap/icheck-bootstrap.min.css">
/public/dist/css/adminlte.min.css">

=APP_NAME;?>
Inicio de seción
**Controller_login.php**
prepare($sql);
$query->execute(['email' => $email]);
$usuarios = $query->fetchAll(PDO::FETCH_ASSOC);
//print_r($usuarios);
$contador = 0;
foreach ($usuarios as $usuario) {
$password_tabla = $usuario['password'];
$contador = $contador +1;
}
if( ($contador>0) && (password_verify($password, $password_tabla)) ) {
//Inicio de sesión
session_start();
$_SESSION['mensaje'] = "Bienvenido al sistema";
$_SESSION['icono'] = "success";
$_SESSION['sesion_email'] = $email;
header('Location: ' . APP_URL . "/administrador");
exit();
}else {
//Manejo de error
session_start();
$_SESSION['mensaje'] = "Los datos introducidos son incorrectos, vuelva a intentarlo";
$_SESSION['icono'] = "error";
header ('Location: ' . APP_URL . "/login");
exit();
}
katerin is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
4