Thanks a lot for your help.

You're absolutely right "This usually happens if you have ANY character
printed out before the view actually renders. It can be a single space after
the closing php tag of a php file (controller, model, ...)."

Actually, I had a lot of space in my model file after closing php tags ?>.
So i removed closing php tag from my model file and it worked just fine.

So, I've just one think to ask to you that should i skip closing php tag in
my every controller and model file. and can i also skip in view file ????

Thank you once again...

On Fri, Oct 8, 2010 at 11:25 PM, euromark <dereurom...@googlemail.com>wrote:

> This usually happens if you have ANY character printed out before the
> view actually renders. It can be a single space after the closing php
> tag of a php file (controller, model, ...). Therefore you should not
> use ?> at the end of php files (CakePHP took the same path in summer
> 2010). It prevents this from happening.
>
>
> On 8 Okt., 19:23, Ashwani Kumar <ashwani.mail...@gmail.com> wrote:
> > Hi all
> >    I'm trying to save some data using add() method in cakephp. This is
> > add () method :
> >
> > function add() {
> >                         if (!empty($this->data)){
> >                                 if ($this->Book->save($this->data)) {
> >                                         $this->Session->setFlash('Data
> has been saved Successfully!',
> > true);
> >                                         $this->redirect(array('action' =>
> 'index'));
> >                                 }
> >                         }
> >                 }
> > Data is getting saved, but i'm getting following error
> onhttp://localhost/data-access/books/addpage.
> >
> > Warning (2): Cannot modify header information - headers already sent
> > by (output started at C:\webs\test\data-access\models\book.php:8) [CORE
> > \cake\libs\controller\controller.php, line 644]
> >
> > 3 queries took 8 ms Nr  Query   Error   Affected        Num. rows
> Took (ms)
> > 1       DESCRIBE `books`                5       5       7
> > 2       INSERT INTO `books` (`isbn`, `title`, `description`,
> `author_name`)
> > VALUES ('123', 'test book', 'hi! this is a test.', 'author xyz')
>        1               1
> > 3       SELECT LAST_INSERT_ID() AS insertID             1       1       0
> >
> > I'm not a cakephp expert, rather i'm learning cakephp. Any reply will
> > be appreciated. Thanks in advanced.
> >
> > Ashwani
> > ashwani.mail...@gmail.com
>
> Check out the new CakePHP Questions site http://cakeqs.org and help others
> with their CakePHP related questions.
>
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com<cake-php%2bunsubscr...@googlegroups.com>For
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

Reply via email to