Header does not redirect even when i removed white space
<p>I have included a header() in my code however it does not redirect. i know that there should not be any white space before the header() is sent but still it does not work. can someone help please. thanks in advance.</p>

<pre><code>&lt;?php 
    session_start();
    if(isset($_SESSION["owner"])){
        header("Location:index.php");
        exit();
    }
?&gt;
&lt;?php
require_once("includes/connection.php");
if(isset($_POST["username"]) &amp;&amp; isset($_POST["password"])){
$owner = $_POST["username"];
$password = $_POST["password"];
$query = "SELECT id FROM users WHERE username = '$owner' AND password ='$password' LIMIT 1";
 $sql = mysql_query($query,$connection);
 $existCount = mysql_num_rows($sql);
        if($existCount == 1){   
        while($row = mysql_fetch_array($sql)){
        $id = $row["id"];
        }
        $_SESSION["id"] =$id;
        $_SESSION["owner"] = $owner; 
        $_SESSION["password"] =$password;
        header("Location:list.php");
        exit();
        }else{
        header("Location:login.php");
        exit();
        }
}
require_once("includes/header.php");?&gt;
&lt;div class="cBoth"&gt;&lt;/div&gt;
&lt;div id="sep"&gt;&lt;/div&gt;

&lt;div class="Calign"&gt;
&lt;div id="formcontent"&gt;

&lt;div class="flotr"&gt;
 &lt;h2&gt;Learn More&lt;/h2&gt; 
 &lt;p class="widthis"&gt;Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source.&lt;/p&gt;
&lt;/div&gt;&lt;!-- end of flotr div text ---&gt;

&lt;div class="flotr"&gt;
   &lt;fieldset class="spacing"&gt;
   &lt;form method="post" action="admin/formProc/formproc.php"&gt;
     &lt;h2&gt;New to MaalHouse?&lt;/h2&gt;
     &lt;p class="widthis"&gt;A Maalhouse account is required to continue.&lt;/p&gt; 
     &lt;p class="formsp"&gt;Name&lt;/p&gt;
     &lt;p&gt;&lt;label&gt;&lt;input type="text" name="username" height="15px"/&gt;&lt;label&gt;&lt;/p&gt;
     &lt;p class="formsp"&gt;Email&lt;/p&gt;
     &lt;p&gt;&lt;label&gt;&lt;input type="text" name="email"/&gt;&lt;label&gt;&lt;/p&gt;
     &lt;p class="formsp"&gt;Re-email&lt;/p&gt;
     &lt;p&gt;&lt;label&gt;&lt;input type="text" name="reemail"/&gt;&lt;label&gt;&lt;/p&gt;
     &lt;p class="formsp"&gt;Password&lt;/p&gt; 
     &lt;p&gt;&lt;label&gt;&lt;input type="password" name="password"/&gt;&lt;label&gt;&lt;/p&gt;
     &lt;p class="formsp"&gt;Re-password&lt;/p&gt;
     &lt;p&gt;&lt;label&gt;&lt;input type="password" name="repassword"/&gt;&lt;label&gt;&lt;/p&gt;
     &lt;p class="formsp"&gt;&lt;label&gt;&lt;input type="submit" name="newuser" value="SING ME UP"/&gt;&lt;label&gt;&lt;/p&gt;
   &lt;/form&gt;
  &lt;/fieldset&gt;
&lt;/div&gt;&lt;!-- end of flotr div sign up---&gt;




&lt;div class="flotl"&gt;
   &lt;fieldset class="spacing"&gt;
   &lt;form method="post" action="login.php"&gt;
   &lt;h2&gt;New to MaalHouse?&lt;/h2&gt;
   &lt;p class="widthis"&gt;A Maalhouse account is required to continue.&lt;/p&gt; 
   &lt;p class="formsp"&gt;Username&lt;/p&gt;
   &lt;p&gt;&lt;input type="text" name="username"/&gt;&lt;/p&gt;
   &lt;p class="formsp"&gt;Password&lt;/p&gt;
   &lt;p&gt;&lt;input type="password" name="password"/&gt;&lt;/p&gt;
   &lt;p&gt;&lt;/p&gt;
   &lt;p class="formsp"&gt;&lt;label&gt;&lt;input type="submit" name="login" value="Login"/&gt;&lt;label&gt;&lt;/p&gt;   
   &lt;/form&gt;
   &lt;/fieldset&gt;
&lt;/div&gt;&lt;!-- end of flotl div login---&gt;


 &lt;/div&gt;
&lt;/div&gt;


&lt;div class="cBoth"&gt;&lt;!-- clear Both--&gt;&lt;/div&gt; 
&lt;?php require_once("includes/footer.php"); ?&gt; 
</code></pre>
