Monday, November 1, 2010

Re: need help with form

You just need to do this:
echo $form->create('Result', array('action' => 'person'));
and you will be posting it to that action.
There you can do the query you need...


anyway, according to your code, you can do this:
function findperson()
{
if (!empty($this->data)) {
$this->redirect($this->action.'/person/'.$this-
>data['Result']['lname'].'/'.$this->data['Result']['fname']);
}
}

Regards.

On Oct 31, 9:48 pm, Briko03 <nathanrlar...@gmail.com> wrote:
> Here is my view:
>
> <?php
> echo $form->create('Result', array('action' => 'findperson'));
> echo $form->input('lname');
> echo $form->input('fname');
>
> echo $form->submit();
> echo $form->end();
> ?>
>
> Here is the action:
>
> function findperson()
>            {
>                 if (!empty($this->data)) {
>                         $this->redirect(array('action' => 'person'));
>                         }
>                 }
>         //I want to append this to the redirect - $this->data['Result']
> ['lname']
>
> I am kind of stuck at the moment and not sure what I am doing
> wrong....
>
> Right now when i click submit i just get a blank white screen. I would
> like the form to take the values of fname and lname and append them to
> my url.....
>
> for example...
>
> results/person/lname/fname
>
> Any code/help would be appreciated....

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

No comments: