cake-php@googlegroups.com
[Top] [All Lists]

Re: action redirect not working

Subject: Re: action redirect not working
From: Miles J
Date: Wed, 17 Nov 2010 18:54:41 -0800 PST
So whats line 746?

It seems you are echoing code before the redirect somewhere.

On Nov 17, 5:28 pm, Briko03 <nathanrlar...@xxxxxxxxx> wrote:
> I have an form/action that I am trying to get to redirect based on
> submitted values....
>
> For some reason when I try to get my form to redirect to my url I get:
> Warning (2): Cannot modify header information - headers already sent
> by ....CORE/cake/libs/controller/controller.php, line 746
>
> My goal is to get the form to redirect to the action and eventually
> include parameter values in the redirect as well.
>
> I hope I made this clear to everyone. I have included my code below.
> ---------------------------------
>
> action code:
> if (!empty($this->data['Result']['location'])) {
>
>                         $this->redirect(array("controller" => "results",
>                       "action" => $this->data['Result']['location']));
>
> }
>
> ----------------------------------
> form code:
>
> <?php
>
> echo $form->create('Result', array('action' => 'findrace'));
>
> echo $form->input('location',array('type'=>'select','options'=>
> $locations,'label'=>'Location*'));
> echo $form->input('season',array('type'=>'select','empty'=>'Select
> One','options'=>$seasons));
> echo $form->input('racenum',array('type'=>'select','empty'=>'Select
> One','options'=>$races,'label'=>'Race #'));
> echo $form->input('sex',array('type'=>'select','empty'=>'Select
> One','options'=>array('M'=>'Male','F'=>'Female')));
> echo $form->input('class',array('type'=>'select','empty'=>'Select
> One','options'=>$classs));
> echo $form->submit();
>
> echo $form->end();
> print '<small>*required field</small>';
>
> ?>

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@xxxxxxxxxxxxxxxx
To unsubscribe from this group, send email to
cake-php+unsubscribe@xxxxxxxxxxxxxxxx For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

<Prev in Thread] Current Thread [Next in Thread>