title: Cannot modify header information - headers already sent by (output started at. What does this mean?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/1912029/warning-cannot-modify-header-information-headers-already-sent-by-error">&ldquo;Warning: Cannot modify header information - headers already sent by&rdquo; error</a><br>
    <a href="https://stackoverflow.com/questions/8028957/headers-already-sent-by-php">Headers already sent by PHP</a>  </p>
  </blockquote>
  
  
  
  <p>I have looked at many other sites that state the problem is because of white spacing. I dont think that is the problem since I dont leave any white spacing after the end of my php script and before the begginning of my php script. Here is the full error  </p>
  
  <p>:  Cannot modify header information - headers already sent by (output started at /admin/login.php:19) in admin/login.php on line 22</p>
  
  <p>Here is my code:</p>
  
  <pre><code>       &lt;?php
          require_once("../../includes/database.php");
          require_once("../../includes/session.php");
          require_once("../../includes/user.php");
  
          if($session-&gt;is_logged_in())
          {
          header("Location:index.php");
          }
          if(isset($_POST['submit']))
          {
          $username = trim($_POST['username']);
          $password = trim($_POST['password']);
          //Check Databases
          $found_user = User::authenticate($username, $password);
          $found_user-&gt;id = $found_user[0];
          if($found_user)
          {
              $session-&gt;login($found_user);
              header("Location:index.php");
          }
          else
          {
              echo "Username/password combination incorrect.";
          }
              } else { //form is not submitted
          $username = "";
          $password = "";
          }
         ?&gt;
         &lt;html&gt;
             &lt;head&gt;
             &lt;/head&gt;
             &lt;body&gt;
             &lt;h1&gt;Photo Gallery&lt;/h1&gt;
             &lt;div id="main"&gt;
             &lt;h2&gt;Staff Login&lt;/h2&gt;
             &lt;form action="login.php" method="post"&gt;
             &lt;table&gt;
           &lt;tr&gt;
                  &lt;td&gt;Username:&lt;/td&gt;
                  &lt;td&gt;
                    &lt;input type="text" name="username" maxlength="30" value="" /&gt;
                  &lt;/td&gt; 
              &lt;/tr&gt;
              &lt;tr&gt;
                  &lt;td&gt; Password:&lt;/td&gt;
                  &lt;td&gt;
                    &lt;input type="password" name="password" maxlength="30" value="" /&gt;
                  &lt;/td&gt;
              &lt;/tr&gt;
              &lt;tr&gt;
                  &lt;td colspan="2"&gt;
                    &lt;input type="submit" name="submit" value"Login" /&gt;
                  &lt;/td&gt;
              &lt;/tr&gt;
             &lt;/table&gt;
             &lt;/form&gt;
             &lt;/div&gt;
             &lt;/body&gt;
             &lt;/html&gt;
              &lt;?php if(isset($database)) 
          {
                  $database-&gt;close_connection();
          }
             ?&gt;
  </code></pre>