Re: Problem with accessing form data
$this->redirect(array('controller' => $controller, 'action' => $action, $id, 'named' => $named, 'named2' => $named2)); On Feb 22, 9:58 am, newguy wrote: > Hi > I have a simple form in my view where the user enters a 4 digit > numeral code, in the controller action am unable to access this code, > it would be great if some one could tell me how to access this code in > the action and then pass this code as a parameter to another > controller action. > > ***Form** > Enter User Code > Create('Admin',array('action'=>'view_specific')); > echo $form->input('Code'); > echo $form->end('Submit'); > ?> > > *Action > function view_specific() > { > if($this->data) > { > // $code=get data from teh form; > > > //$this->redirect(array('action'=>'view_specific_result', > $code)); > > } > } > > Thanks -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. 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
RE: Problem with accessing form data
$this->data // holds form data Use debug! Make it your best friend. Don't know what data is held? Where it went? Even if there is any? if(!empty($this->data)){ Configure::write('debug', 2);//only if you need it for this action debug($this->data); exit(); } My guess is it should be an array similar to Array( [Admin] => array( [Code] => 1234 )); So $this->data['Admin']['Code'] would hold 1234 HTH.. K -Original Message- From: cake-php@googlegroups.com [mailto:cake-php@googlegroups.com] On Behalf Of newguy Sent: Tuesday, February 22, 2011 12:28 PM To: CakePHP Subject: Problem with accessing form data Hi I have a simple form in my view where the user enters a 4 digit numeral code, in the controller action am unable to access this code, it would be great if some one could tell me how to access this code in the action and then pass this code as a parameter to another controller action. ***Form** Enter User Code Create('Admin',array('action'=>'view_specific')); echo $form->input('Code'); echo $form->end('Submit'); ?> *Action function view_specific() { if($this->data) { // $code=get data from teh form; //$this->redirect(array('action'=>'view_specific_result', $code)); } } Thanks -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. 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 -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. 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
Problem with accessing form data
Hi I have a simple form in my view where the user enters a 4 digit numeral code, in the controller action am unable to access this code, it would be great if some one could tell me how to access this code in the action and then pass this code as a parameter to another controller action. ***Form** Enter User Code Create('Admin',array('action'=>'view_specific')); echo $form->input('Code'); echo $form->end('Submit'); ?> *Action function view_specific() { if($this->data) { // $code=get data from teh form; //$this->redirect(array('action'=>'view_specific_result', $code)); } } Thanks -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. 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