Welcome Guest, Not a member yet? Register   Sign In
Validated form data - where does it go?!?
#1

[eluser]juddmuir[/eluser]
Hi,

I'm using the form validation class to trim and validate form data:

$this->form_validation->set_rules('classified_title', 'lang:classified_title', 'trim|required|xss_clean');

But once validated, where do I get the trimmed data? If I use the post array, then I've lost the data that's been processed :-(

Where does the submitted data go once it's been validated?!?
#2

[eluser]GSV Sleeper Service[/eluser]
the validation ruless (trim, xss_clean etc) are performed directly on the $_POST array, so using $this->input->post() will be fine.
a comment from the form_validation class
Code:
/**
     * Re-populate the _POST array with our finalized and processed data
     *
     * @access    private
     * @return    null
     */
#3

[eluser]juddmuir[/eluser]
Thanks!
#4

[eluser]Michael Wales[/eluser]
Validated form data can be found in:
Code:
$this->input->post('field');
$_POST['field'];
$this->validation->field;

Personally, I would use the Input class - there's no difference right now between the three, but in the future this may change. The Input class was designed to access this data specifically, in theory you should never touch the $_POST array yourself - let the framework do it for you.




Theme © iAndrew 2016 - Forum software by © MyBB