$this->form_validation->run() is altering $_POST |
Hello,
I don't understand what happens with the following code: Code: var_dump( $this->input->post('username') ); First var_dump() output: Code: string(1) ">" Second var_dump() output: Code: string(4) ">" In my actual code, this issue prevents me from doing this: Code: // In the controller: It is very easy to fix in the above example, but my actual code is much more complicated, and the only easy fix I have found is this: Code: $post_backup = $_POST; Is it a bug in Codeigniter that $_POST is altered by $this->form_validation->run() ? The documentation says nothing about this behavior.
Actually it my be something wrong with your .htaccess. As far as I see from the library's code, Codeigniter form_validation doesn't mess with the $_POST. Try this: http://stackoverflow.com/questions/47331...n-htaccess
Perhaps you are calling a one of the Form Validation prepping functions (such as prep_for_form)?
From the User Guide: In addition to the validation functions like the ones we used above, you can also prep your data in various ways. Note: You will generally want to use the prepping functions after the validation rules so if there is an error, the original data will be shown in the form. |
Welcome Guest, Not a member yet? Register Sign In |