CodeIgniter Validation: can I check GET query strings?

The form validation library seems to work only with POST. I need to use query strings and would like to use CI to check for passed values. Is there any way to do this?

+5
source share
4 answers

The current Codeigniter 3.0 development branch provides the ability to embed your own variable instead of $ _POST. Therefore, you can start using 3.0.

Alternatively, the only way in CI2.1 is to do $ _POST = $ _ GET before starting the check.

+10
source

. CodeIgniter 3: - http://www.codeigniter.com/userguide3/libraries/form_validation.html#validating-an-array-other-than-post

CodeIgniter 2 $_POST = $_GET; $this- > form_validation- > run(), .

+2

Form_validation MY_Form_Validation .

+1

Codeigniter Get?

.

 $this->form_validation->set_data($_GET);
+1

All Articles