The error is telling you that you can't send any headers to the browser after sending content. Headers come first (hence the name), then content. As soon as you ask PHP to send any content (HTML, or an image file, or a blank line for that matter), PHP will send all of the headers it's collected so far, and then start sending the content. Once it does that, it's too late to send any more headers.
So if you want to send any headers, don't send anything else to the browser first. (Why would you want to send anything anyway? You're trying to redirect the browser to another page...)
For more ways of saying the same thing, go to the forum search page thing, go to the search page, and paste headers already sent into the text box there.