grahamgr3 Posted October 23, 2014 Share Posted October 23, 2014 I am creating a site using the registration system in chapter 18, and I am using the output buffer on every page, the ob_start() is included in every page via the header.html file. In the book it says that if we use the output buffer we won't get headers already sent error messages. But I just tested it and put a space before the starting <?php tag. And I got the following error. Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /home/ why does it give an error message. Link to comment Share on other sites More sharing options...
Larry Posted October 24, 2014 Share Posted October 24, 2014 You won't get that error message assuming nothing is sent outside of the output buffering. If you put a space before the opening PHP tag, then you've sent something to the browser before output buffering was turned on. Link to comment Share on other sites More sharing options...
Recommended Posts