CodeIgniter Validation: possible to validate GET query strings?

前端 未结 4 656
醉话见心
醉话见心 2020-12-18 07:23

The form validation library seems to only work on POST. I need to use query strings and would like to use CI to validate the passed values. Is there a way to do this?

4条回答
  •  青春惊慌失措
    2020-12-18 07:45

    Reference How do I validate a form field in Codeigniter when using Get parameters?

    Before validation rules, set the validation data with the following code.

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

提交回复
热议问题