NO FRICK NO!
HTTP HEADERS ARE ALWAYS SENT BEFORE THE DATA. THATS THE WAY HTTP WORKS!
ob_start() simply tells PHP to NOT SEND DATA UNTIL THE HEADERS ARE SENT!
So it waits until the script ends or you call ob_end_flush() and then SENDS THE HEADERS, AND THEN SENDS THE DATA!
You might be placing the echo() or print() before the calls to header() but never-the-less, PHP isn't going to send any of your actual data UNTIL AFTER IT SENDS THE HEADERS!
So to conclude this thread, you CANNOT, I repeat, CANNOT send data before HTTP HEADERS. You can tell PHP to not send the data until after all headers are sent ( thats what ob_start() is esentially doing, collecting data until all the headers are sent and then sending data ) but you can't send data then headers.
If you look at an HTTP request, the HTTP request / response is actually just plain text placed before the data. The only reason you don't see it is because your browser hides it. If you sent data, then the headers, the browser wouldn't know what to display it as, and the HTTP response would probably get printed out somewhere in the middle of your HTML page.