title: PHP Header (Location) errors
body: <p>Whenever i open the page i receive following errors:</p>
  
  <blockquote>
    <p>[04-Jul-2012 17:10:45] PHP Warning:  Cannot modify header information
    - headers already sent by (output started at /home/test/public_html/admin/header.php:39) in
    /home/test/public_html/admin/edAgent.php on line 80</p>
    
    <p>[04-Jul-2012 17:10:55] PHP Warning:  Cannot modify header information
    - headers already sent by (output started at /home/test/public_html/admin/header.php:39) in
    /home/test/public_html/admin/edAgent.php on line 80</p>
  </blockquote>
  
  <p>Pieces of code including headers:</p>
  
  <p><strong>Encoding header:</strong></p>
  
  <pre><code>header('Content-Type: text/html; charset=utf-8');
  </code></pre>
  
  <p><strong>Login redirect header:</strong></p>
  
  <pre><code>if(!isset($_SESSION["login"])OR $_SESSION["login"]!=1){        
      header('Location: login.php');
      exit;     
      }
  </code></pre>
  
  <p><strong>Checks if logged user has privileges to edit:</strong></p>
  
  <pre><code>if($level!='4') {
      header('Location: acd.php?msg=1');
      exit;
  }
  </code></pre>
  
  <p><strong>Checks if ID exists:</strong></p>
  
  <pre><code>if ($nUsers==0) {    
      header('Location: acd.php?msg=2');
      exit;    
  }
  </code></pre>
  
  <p><strong>Checks if information is editable:</strong></p>
  
  <pre><code>if($access != '4') {        
      header('Location: acd.php?msg=1');
      exit;        
  }
  </code></pre>