I get header problem while I use ob_start() in the beginning of a page and ob_end_flush() at the end. Because I use header function after some query execution.
 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->query($countstmt);  
 if($delHourExist){
      header("location:edit_delivery_hours.php");
 }
 ....
include_once('footer.php');
ob_end_flush();
In header.php there I also added ob_start(); and in footer.php i added ob_end_flush(); , but I think that is not problem, although other pages are running with same script I write above
The error I am getting:
Warning: Cannot modify header information - headers already sent in D:\xampp\htdocs\project\add_book_hours.php on line 9
 
     
     
     
     
     
    