title: How to display alert box in login screen in php. if a user enter's a wrong password or username for this code
body: <p>How to display alert box in login screen in php. </p>
  
  <p>if a user enter's a wrong password or username for this code</p>
  
  <pre><code>if(isset( $_POST['email'])){
      $email = $_POST['email'];
      $cpassword = $_POST['cpassword'];
  
      include ("../backend/user.php");
      $c = new customer();
      //Assign username &amp; password from post method to a varibale
      $res = $c-&gt;customer_login($email,$cpassword);
      if($res == true){
        //Direct the user to appropriate page 
        header("location:../views/profile.php");
      }else{
  
        include ("../backend/admin.php");
        $a = new admin();
        //Assign username &amp; password from post method to a varibale
        $res = $a-&gt;admin_login($email,$cpassword);
        if($res == true){
          //Direct the user to appropriate page 
          header("location:../views/admin.php");
        }
      }
      //Display message invalid user name or password
      $message = "invalid username or password";
    }
  </code></pre>