i m getting header problem while i m using ob_start(); in the start of a page and ob_end_flush(); end of the page. because i m using header function after some query execution
my code is here
<?php ob_start();?>
<?php include_once("header.php"); ?>
<?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); /* i m using ez mysql class*/ output is 1
if($delHourExist)
{
header("location:edit_delivery_hours.php");
}
-------------------
--------------------
--------------------
some php codes
--------------------
--------------------
<?php include_once('footer.php');
<?php ob_end_flush();?>
here one thing i tell u in header.php there i also add 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
please tell me what to do?
EDIT: i m getting
Warning: Cannot modify header information - headers already sent in D:\xampp\htdocs\project\add_book_hours.php on line 9