How to resolve Cannot modify header information warninig in cakePHP
I am getting the below warning w开发者_Python百科hen i tried to do redirection.please help me to solve this fix this.
Cannot modify header information - headers already sent by (output started at D:\Program Files\xampp\htdocs\cakePHP\cake\libs\debugger.php:673) [CORE\cake\libs\controller\controller.php, line 742]
This error occurs if there is any output before calling header()
function. The most common and mostly "invisible" mistake is having whitespaces at the beginning or the end of one or more of your files. Make sure there are none before opening <?php
or after closing ?>
tags.
Additionally you may also try:
- Configure your editor to trim trailing whitespaces before saving the file.
- Pre-commit hooks in the SCM of your choice.
- The tip from Tomba (see comment below), if you cannot pinpoint the location of your trouble.
ob_start();
It's helpful.write ob_start();
in controller
精彩评论