Welcome Guest, Not a member yet? Register   Sign In
CI input class eating my JSON!
#1

[eluser]_TubbZ_[/eluser]
Hello,

I created a javascript client side app to construct some elements on my site and then pass this data to CI to store in my database. I originally intended just to pass the data as JSON from JavaScript to CI but CI cleans out the POST input because of the encoding. I am now a bit stumped on the best way to do this! What would people recommend as the best method to achieve this not being able to use JSON?

Thanks!
#2

[eluser]kcmerrill[/eluser]
$_POST may be cleared out(I think) but are your variables showing up in $this->input->get_post()? check if var_dump($this->input->get_post()); displays what you're looking for.

I've done this multiple times by posting through jquery's ajax(http://api.jquery.com/jQuery.ajax/) with no issues.

Without seeing code this is just a guest/suggestion.
Best of Luck,
-kc
#3

[eluser]_TubbZ_[/eluser]
Nope both gets cleared by CI because of the syntax. I think I will just use a big array of hidden form elements or use JQuery to pass it back with ajax instead of caching it and passing it as one .
#4

[eluser]InsiteFX[/eluser]
Did you search the forums for CSRF ?

InsiteFX




Theme © iAndrew 2016 - Forum software by © MyBB