Welcome Guest, Not a member yet? Register   Sign In
$_POST after validation
#1

[eluser]wakextreme[/eluser]
Is the POST array repopulated with validated data after validation is run? For example if I have trim|xss_clean in my validation is the data cleaned and put back into POST?

I know the clean data is accessible through the validation class but if the post array is repopulated and I validated all data in the array it would be nice to be able to just pass off the post array to whatever is processing it rather than accessing each var individually through the validation class.
#2

[eluser]Michael Ekoka[/eluser]
No the POST keeps the original values.
#3

[eluser]alexsancho[/eluser]
You're right wakeextreme, $_POST is repopulated after validation,

extract from validation library

Code:
/**
     * XSS Clean
     *
     * @access    public
     * @param    string
     * @return    string
     */    
    function xss_clean($str)
    {
        $_POST[$this->_current_field] = $this->CI->input->xss_clean($str);
    }
#4

[eluser]Michael Wales[/eluser]
After form validation the following 3 have the same data:
Code:
$_POST['var'];
$this->input->post('var');
$this->validation->var;
#5

[eluser]wakextreme[/eluser]
[quote author="Michael Wales" date="1197509320"]After form validation the following 3 have the same data:
Code:
$_POST['var'];
$this->input->post('var');
$this->validation->var;
[/quote]

Great! That is what i thought but i just wanted to verify it.

Thanks for the replies.




Theme © iAndrew 2016 - Forum software by © MyBB