prepare("SELECT * FROM user WHERE login = ?");
$stmt->bind_param("s", $login);
$stmt->execute();
$result = $stmt->get_result();
if ($result->num_rows > 0) {
$row = $result->fetch_assoc();
$hash = $row['mdp'];
$mail = $row['mail'];
$nom = $row['nom'];
$prenom = $row['prenom'];
$genre = $row['genre'];
$role = $row['Role'];
if (password_verify($password, $hash)) {
$_SESSION['login'] = $login;
$_SESSION['mail'] = $mail;
$_SESSION['nom'] = $nom;
$_SESSION['prenom'] = $prenom;
$_SESSION['genre'] = $genre;
$_SESSION['role'] = $role;
header('Location: ../index.php');
exit();
} else {
$error_verif2 = "Mot de passe incorrect";
}
} else {
$error_verif = "Ce login n'existe pas";
}
$stmt->close();
}
?>
Connexion
"; } ?>
$error_verif2"; } ?>
Vous ne possédez pas de compte ?
Inscrivez-vous !