title: Cannot modify header information - headers already sent (Confused)
body: <p>I'm making a script that will integrate with phpVMS's login system.</p>
  
  <p>I've got it working, if someone goes to the page logged in it will show. How can I make it so that when someone opens the webpage, not logged in, it sends them to the login page?</p>
  
  <p>Currently, I get the error:</p>
  
  <blockquote>
    <p>Cannot modify header information - headers already sent by (output started at /home/a4366948/public_html/mindfulhacker/private/man/index.html:11) in /home/a4366948/public_html/mindfulhacker/private/man/index.html on line 16</p>
  </blockquote>
  
  <p>I saw another post about this same problem, but I was confused on how I could have a stylesheet working at the same time - there is no point having just a unformatted page!</p>
  
  <pre><code>    &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;&lt;head&gt;
          &lt;meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"&gt;
          &lt;meta http-equiv="Content-Language" content="en-gb"&gt;
  &lt;meta name="language" content="eng"&gt;
  &lt;meta name="resource-type" content="document"&gt;
          &lt;link rel="stylesheet" href="style.css" type="text/css"&gt;        
                      &lt;title&gt;Management System || CCVG&lt;/title&gt;
  &lt;?php include('/home/a4366948/public_html/core/codon.config.php'); ?&gt;
                                          &lt;/head&gt;
                      &lt;body&gt;
                          &lt;div class="container"&gt;
                              &lt;div class="pagetitle"&gt;CapitalConnect Virtual Group - Management System&lt;/div&gt;
                              &lt;?php
                                  if(Auth::LoggedIn()) {
                              ?&gt;
                              &lt;div class="menu"&gt;&lt;table class="tb_blue_full margin_10" align="center" border="0" cellpadding="0" cellspacing="0" width="780"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="cell_blue_botright" height="25" width="260"&gt;&lt;div align="center"&gt;&lt;strong&gt;&lt;a href="/home/login_sso.php"&gt;Away Status&lt;/a&gt;&lt;/strong&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class="cell_blue_botright"  height="25" width="260"&gt;&lt;div align="center"&gt;&lt;strong&gt;&lt;a href="/home/status.php"&gt;Students&lt;/a&gt;&lt;/strong&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class="cell_blue_bot" height="25" width="260"&gt;&lt;div align="center"&gt;&lt;strong&gt;&lt;a href="/bookings/calendar.php"&gt;Classes&lt;/a&gt;&lt;/strong&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;
                             &lt;?php
  } else {
  
  header("Location: ".url('/login'));
  exit;
  
  }
  ?&gt;
          &lt;div style="clear: both;"&gt;&amp;nbsp;&lt;/div&gt;
  &lt;/div&gt;
  &lt;/body&gt;&lt;/html&gt;
  </code></pre>