I have read the other thread on this specific topic but I believe that there is white space being generated by ob_end_flush()
.
- In my code if I precede my call to
ob_end_flush()
with aheader()
the header works - If remove the leading
header()
and put it after the call toob_end_flush()
then the header fails to execute. - In the latter case, I inspect the page (Control-U in FireFox) and see one blank line
Here is the code with BOTH header calls. again, the leading header works but if I remove the 1st header the header subsequent to ob_end_flush()
fails.
header('location:administrative page.php'); //-- return
ob_end_flush();
header('location:administrative page.php'); //-- return
The problem cannot be related to any undetected leading or trailing white space above or below my "PROBLEM AREA" code since the 1st header works.
Any ideas? ======================================== addendum 2/12/2015 Thanks to both replies... I need to pay more attention to my error logs in challenging times ...
The "surprise" to me is that evidently ob_end_flush() initiates a header send and thus "my" subsequent header construct is blocked. Line 101 is: ob_end_flush(); Line 105 is: header('location:administrative page.php');
20150212T083215: www.summersessiondevelopment.com/report.php
PHP Warning: Cannot modify header information - headers already sent by (output started at /hermes/waloraweb026/b1614/moo.aassdevelopmentcom/report.php:101) in /hermes/waloraweb026/b1614/moo.aassdevelopmentcom/report.php on line 105
so, my task is to now find the definitive way to flush my fputcsv() buffer before I close the file with fclose($fp) without using ob_end_flush();
I used a brute force method trying to find a way to flush the buffer so I will check to see if removing ob_end_flush() and only using:
ob_flush();
flush();
fclose($fp);
does the trick.
Again THANKS guys!