CodeIgniter Forums
how get validate data& - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=22)
+--- Thread: how get validate data& (/showthread.php?tid=58070)



how get validate data& - El Forum - 05-11-2013

[eluser]Unknown[/eluser]
controller
Code:
class Place extends CI_Controller
{

public function index()
{
  $this->load->view('index');
}

public function create()
{
  $this->load->library('form_validation');
  
  $this->form_validation->set_rules(array(
      array(
          'field' => 'ptitle',
       'label' => 'Place Title',
    'rules' => 'htmlspecialchars|trim|xss_clean|required|min_length[3]|max_length[150]'
   ),
    array(
          'field' => 'pdescription',
       'label' => 'Place Description',
    'rules' => 'required|xss_clean|xss_clean'
   ),
  ));

  if ($this->form_validation->run() == FALSE)
  {        
                                  // VALIDATION POST
   $form = 'form';
  }
  else
  {
   $form = 'succes_form';
  }
  
  $this->load->view('createplace', array('form' => $form));
}
}
after check post and validation? how i can get this valid data?