[email protected]
[Top] [All Lists]

action redirect not working

Subject: action redirect not working
From: Briko03
Date: Wed, 17 Nov 2010 17:28:22 -0800 PST
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:


echo $form->create('Result', array('action' => 'findrace'));

echo $form->input('location',array('type'=>'select','options'=>
echo $form->input('season',array('type'=>'select','empty'=>'Select
echo $form->input('racenum',array('type'=>'select','empty'=>'Select
One','options'=>$races,'label'=>'Race #'));
echo $form->input('sex',array('type'=>'select','empty'=>'Select
echo $form->input('class',array('type'=>'select','empty'=>'Select
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 [email protected]
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at 

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