title: PHP error: Cannot modify header information – headers already sent
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/8028957/headers-already-sent-by-php">Headers already sent by PHP</a>  </p>
  </blockquote>
  
  
  
  <p>So I have this output on my page.. not understanding why I have it popping up. I'm new to php though, so maybe it's something easy to fix</p>
  
  <p>-I have a header.php file, which includes all important info, as well has the banner of the page. This header.php is included on every page.</p>
  
  <p>-I have it checking the session value to make sure user is allowed to be at a certain page. If user is not allowed to be there, I kick them back to login page</p>
  
  <p>This is where the error comes up though. This is what I have:</p>
  
  <pre><code>include_once ("header.php");
  
  if ($_SESSION['uid']!='programmer')
  {                        
  header('Location: index.php');
  echo 'you cannot be here';
  exit;
  }   
  </code></pre>
  
  <p>The index that it is redirecting to also has the header. So is having these multiple header references giving me this error? I see no other way to do this, and it's driving me nuts!</p>