okay /g/ spent 2 hours looking for the error, plz help
-- above this is an if ( empty( $_POST ) ) {
and then html form
<?php
}
else {
require ("connect.php"); // le code n'execute pas si connect.php n'est pas disponible
$email = $_POST[ 'email' ]; //Récupération des valeurs du formulaire
$mdp = $_POST[ 'mdp' ];
$sql= $db->prepare("SELECT email,mdp FROM users WHERE email = :email and mdp = :mdp");
$sql->bindParam(":email", $email, PDO::PARAM_STR);
$sql->bindParam(":mdp", $mdp, PDO::PARAM_STR);
$sql->execute();
$count = $sql->fetch(PDO::FETCH_NUM);
if($count!=0){
session_start();
$_SESSION['loggedin'] = true;
$_SESSION['username'] = $email;
$_SESSION['mdp'] = $mdp;
$url = "http://127.0.0.1/Management/index.html";
echo'<script type="text/javascript" >
alert("Bienvenue ! ");
window.location.href="' . $url . '";
</script>';
}
else {
$url2 = "http://127.0.0.1/management/Connexion.html";
echo'<script type="text/javascript" >
alert(" Email ou Mot de passe incorrecte ! ");
window.location.href="' . $url2 . '";
</script>';
}
}
?>