PHP Header issue with ob_start() and ob_end_flush()

前端 未结 5 1113
醉话见心
醉话见心 2020-12-21 12:56

I get header problem while I use ob_start() in the beginning of a page and ob_end_flush() at the end. Because I use header function after some quer

5条回答
  •  無奈伤痛
    2020-12-21 13:50

    There's a lot of invisible output in your code:

     --- THERE IS A LINE RETURN HERE ---
    --- SPACES OR TABS --- --- LINE RETURN ---
    --- AND HERE ---

    Quit starting and ending your php tags. Just do this:

    Make absolutely sure that there is no output, and no whitespace outside of your tags before the call to ob_start(). If your error is on line 9, you've got a bunch of lines before that call that could be the problem. You may want to post all of those lines, numbered, so we can look at them carefully.

提交回复
热议问题