CodeIgniter Forums
CI input class eating my JSON! - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: CI input class eating my JSON! (/showthread.php?tid=39959)



CI input class eating my JSON! - El Forum - 03-25-2011

[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!


CI input class eating my JSON! - El Forum - 03-25-2011

[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


CI input class eating my JSON! - El Forum - 03-25-2011

[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 .


CI input class eating my JSON! - El Forum - 03-25-2011

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

InsiteFX