Welcome Guest, Not a member yet? Register   Sign In
validation rule for a json object?
#1

(This post was last modified: 11-19-2020, 09:41 AM by amt3.)

Code:
       $_POST=$this->request->getJSON(true);
       $rules=[
           "name"=>"required",
       ];
       if($this->validate($rules))
           return "ok";
       else
           return "error";
always returns false
Reply
#2

And where are you getting the json data from?

Also you should not be assigning it to the $_POST.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#3

(11-19-2020, 04:44 PM)InsiteFX Wrote: And where are you getting the json data from?

Also you should not be assigning it to the $_POST.
I want to confirm requests sent in json
[Image: 123.jpg?t=ol4eo4e4]
Reply




Theme © iAndrew 2016 - Forum software by © MyBB