Problem with use of redirect function
Hi,
i am new to cakePhp, I just started using this framework. I made blog application, the one in examples, and while creating a new post, or editing, or deleting a post I get a warning, the warning is as follows:
Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\cakephp-cakephp1x\app\controllers\posts_controller.php:40) [CORE\cake\libs\controller\controller.php, line 644]
I know this warning is caused as headers are defined again. I tried the code that worked for me in normal php files, that is
<?php ob_start();?> at start of posts_controller.php file
<?php ob_flush();?> at end of posts_controller.php file
but still I am getting the same warning.....
any suggestions, what should I do..??
regards
Sumit
Asked by Sumit, on 1/2/10
1 Answer
you do not use ob_start in cake
check your models for white space after ?> or before <?php
same for the controllers... also make sure you do not have any echos, print_r's or similar in models
Answered by dogmatic69on 1/2/10
what is on PostsController::edit() - APP\controllers\posts_controller.php, line 32
that might be the problem
dogmatic69 - on 2/2/10
Your Answer
You can use Creole Wiki Syntax to format your text.
Tagged with
Rating
0
Viewed
307 times
Last Activity
on 2/2/10