this is the login form....it says that it cannot modify header information and I tried everything to fix but I cant...can someone help me with my codes..thanks in advance
<?php
       $loginpopup = 'Login Success';
       $failpopup = 'Wrong Username or Password';
          if(!$con)
          {
            die("Error connection" . mysqli_connect_error());
          }
    if (isset($_POST['submitlogin']))
    {
       $login = "SELECT * from admin where username  = '$_POST[user]' AND password ='$_POST[pass]'";
            $getuser = mysqli_query($con,$login) or die(mysql_error());
              while($row = mysqli_fetch_array($getuser))
              {
                if($row==0)
                {
                     echo "<SCRIPT>alert('$failpopup');</SCRIPT>";
                     header("location:index.php");
                }
                else
                {
                  echo "<SCRIPT>alert('$loginpopup');</SCRIPT>";
                  header("location:home.php");
                }
              }
    }
    ?>
 
     
     
    