Codeigniter error message Cannot modify header information

后端 未结 4 1320
粉色の甜心
粉色の甜心 2021-01-22 13:28

I got this error message when i run my php CodeIgniter project:

A PHP Error was encountered

Severity: Warning

Message: Cannot modi

4条回答
  •  暖寄归人
    2021-01-22 14:17

    While using codeigniter, its best recommended that you echo only in views.

    Echoing anywhere randomly sends some data to browser, after which you can't modify headers (this includes attempt to redirect, set content-type, etc)

    You should re-organize your code, such that, echo are done within views only. This will solve your header issues in Codeigniter.

    This also includes extra whitespaces at the end after the closing brace "} ?>" in non-view php files.

提交回复
热议问题