CodeIgniter Validation: possible to validate GET query strings?

前端 未结 4 624
醉话见心
醉话见心 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 08:12

    See this page for the CodeIgniter 3 solution:- http://www.codeigniter.com/userguide3/libraries/form_validation.html#validating-an-array-other-than-post

    For CodeIgniter 2 you can do $_POST = $_GET; before $this->form_validation->run() as mentioned above.

提交回复
热议问题