title: login page doesn't show error and doesn't login php
body: <p>this validation page doesn't show error and doesn't redirect to the home page. I check if it reach the verifying from the databse and it works fine but doesn't redirect the page so I think that the problem is with "$user = $req->fetch()"   help plz </p>
  
  <pre><code>if(isset($_POST['login'])){
  
   $username = $_POST['username'];
  $password = $_POST['password'];
   $pc = md5($password);
  
  $req = $pdo-&gt;prepare('SELECT * FROM users WHERE nom= :username AND pass= :password');
  $req-&gt;execute(array(
      'username' =&gt; $username,
      'password' =&gt; $pc,
      ));
  
   if ($user = $req-&gt;fetch()) {
      $_SESSION['auth'] = $user;
      header("location:home.php");
      exit();
  
   }
  
   else{
   echo"&lt;script&gt; alert('LE NOM D UTILISATEUR OU LE MOTS DE PASSE INCORRECTE')&lt;/script&gt;";
  }
  </code></pre>