Jump to content
Larry Ullman's Book Forums

Recommended Posts

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...