Re: redirect and Cannot modify header information
Hi, Thank you for your help : I found the error. It was a presence of space was after the ? That sends a char and create an error On Apr 15, 7:08 pm, Gonzalo Servat [EMAIL PROTECTED] wrote: On Tue, Apr 15, 2008 at 12:59 PM, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: [snip] 2) The execution of this code on Unix server with PHP version 5.2.5, System HP-UX frl4 B.11.11 U 9000/800 generate the following error: Warning (2): Cannot modify header information - headers already sent by (output started at /opt/hpws/apache/htdocs/cake/app/ app_controller.php:75) [CORE/cake/libs/controller/controller.php, line 546] header - [internal], line ?? Controller::redirect() - CORE/cake/libs/controller/controller.php, line 546 PlansController::add() - APP/controllers/plans_controller.php, line 165 Dispatcher::_invoke() - CORE/cake/dispatcher.php, line 268 Dispatcher::dispatch() - CORE/cake/dispatcher.php, line 240 [main] - APP/webroot/index.php, line 84 I do not really manage to understand why I have this error; somebody can help me on this subject? Hi, I had a similar issue to this recently. I had pasted some code from a page into a app/models/ file and it kept sending a blank character/line which meant headers were already sent out (you can verify this by using something like curl to look at the HTTP headers; you'll find you'll receive a 200 OK instead of a moved status message like 301). Try backing up your app_controller.php and starting with a fresh new one. Start to copy code back until it breaks the redirect. Just an idea. - Gonzalo --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
redirect and Cannot modify header information
Hello, I try to make a redirection towards an address in my controller: Code of the controller: --- function add() { $modelClass = $this-modelClass; if (!empty($this-data)) { $this-$modelClass-create(); $this-data['Plan']['description'] = $this-html2text($this- data['Plan']['description']); $this-$modelClass-save($this-data[Plan]); $this-redirect('/'.$this-viewPath.'/index'); } } 1) The execution of this code on my PC with EasyPhp 2.0 works correctly 2) The execution of this code on Unix server with PHP version 5.2.5, System HP-UX frl4 B.11.11 U 9000/800 generate the following error: Warning (2): Cannot modify header information - headers already sent by (output started at /opt/hpws/apache/htdocs/cake/app/ app_controller.php:75) [CORE/cake/libs/controller/controller.php, line 546] header - [internal], line ?? Controller::redirect() - CORE/cake/libs/controller/controller.php, line 546 PlansController::add() - APP/controllers/plans_controller.php, line 165 Dispatcher::_invoke() - CORE/cake/dispatcher.php, line 268 Dispatcher::dispatch() - CORE/cake/dispatcher.php, line 240 [main] - APP/webroot/index.php, line 84 I do not really manage to understand why I have this error; somebody can help me on this subject? Thank you Frédéric --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: redirect and Cannot modify header information
On Tue, Apr 15, 2008 at 12:59 PM, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: [snip] 2) The execution of this code on Unix server with PHP version 5.2.5, System HP-UX frl4 B.11.11 U 9000/800 generate the following error: Warning (2): Cannot modify header information - headers already sent by (output started at /opt/hpws/apache/htdocs/cake/app/ app_controller.php:75) [CORE/cake/libs/controller/controller.php, line 546] header - [internal], line ?? Controller::redirect() - CORE/cake/libs/controller/controller.php, line 546 PlansController::add() - APP/controllers/plans_controller.php, line 165 Dispatcher::_invoke() - CORE/cake/dispatcher.php, line 268 Dispatcher::dispatch() - CORE/cake/dispatcher.php, line 240 [main] - APP/webroot/index.php, line 84 I do not really manage to understand why I have this error; somebody can help me on this subject? Hi, I had a similar issue to this recently. I had pasted some code from a page into a app/models/ file and it kept sending a blank character/line which meant headers were already sent out (you can verify this by using something like curl to look at the HTTP headers; you'll find you'll receive a 200 OK instead of a moved status message like 301). Try backing up your app_controller.php and starting with a fresh new one. Start to copy code back until it breaks the redirect. Just an idea. - Gonzalo --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---