title: PHP Header issue with ob_start() and ob_end_flush()
body: <p>I get header problem while I use <code>ob_start()</code> in the beginning of a page and <code>ob_end_flush()</code> at the end. Because I use header function after some query execution.</p>
  
  <pre><code> ob_start();
   include_once("header.php");
   global $db;
  
   $countstmt="SELECT COUNT(*) FROM tbl_lib_hours dh WHERE book_id IN(SELECT book_id FROM tbl_book WHERE user_id=".$_SESSION['uid'].") ";       
   $delHourExist=$db-&gt;query($countstmt);  
   if($delHourExist){
        header("location:edit_delivery_hours.php");
   }
   ....
  include_once('footer.php');
  ob_end_flush();
  </code></pre>
  
  <p>In <em>header.php</em> there I also added <strong>ob_start();</strong> and in <em>footer.php</em> i added <strong>ob_end_flush();</strong> , but I think that is not problem, although other pages are running with same script I write above</p>
  
  <p>The error I am getting:</p>
  
  <blockquote>
    <p>Warning: Cannot modify header information - headers already sent in D:\xampp\htdocs\project\add_book_hours.php on line 9</p>
  </blockquote>