validating forms |
[eluser]wilfred[/eluser]
I have loaded the following controller but am unable to submit to the database...Please help. <?php class Blog2 extends Controller{ function Index() { $subjects = array('I want to dance'=>'I want to dance', 'I have a real question'=>'I have a real question'); $this->form ->sel('subject',$subjects) ->add('name') ->add('phone') ->add('email') ->ta('notes') ->sub('submit'); $to = "[email protected]"; $subject = "{subject}"; $message = "Name: {name}\n" . "Phone: {phone}\n" . "Email: {email}\n" . "Notes: {notes}"; $values = array($to,$subject,$message); $this->form ->onSuccess('send_email',$values,array('{phone}'=>'phone')) ->onSuccess('redirect', 'thispath/success'); $data = array('form'=>$this->form->get()); $this->load->view('my_view_file', $data); } } ?> |
Messages In This Thread |
validating forms - by El Forum - 11-17-2009, 02:33 AM
validating forms - by El Forum - 11-17-2009, 10:44 AM
|