Welcome Guest, Not a member yet? Register   Sign In
Why NOT use $_POST directly?
#1

[eluser]RJ[/eluser]
The CI way is to grab post params through the input class $this->input->post(). I ask you, why not simply use $_POST?

Thanks
#2

[eluser]osci[/eluser]
$this->input->post() calls _fetch_from_array which checks for $xss_clean === TRUE and uses security class if needed.

You can always use $_POST but you would have to do this stuff yourself.
#3

[eluser]RJ[/eluser]
That's what I thought. Thanks @osci
#4

[eluser]Aken[/eluser]
It also will default to an empty string if that particular $_POST variable doesn't exist, which can be handy (but don't be lazy when you code, mkay).
#5

[eluser]theprodigy[/eluser]
I believe it defaults to the boolean FALSE, not an empty string.
#6

[eluser]InsiteFX[/eluser]
@theprodigy, Correct!

InsiteFX
#7

[eluser]theprodigy[/eluser]
YAY!! What did I win?? :-D
#8

[eluser]InsiteFX[/eluser]
A BOOLEAN TRUE LOL!
#9

[eluser]theprodigy[/eluser]
lol
#10

[eluser]Aken[/eluser]
Drat, you're right. I haven't dealt with any non-required POST fields in a while, haha. My mistake.




Theme © iAndrew 2016 - Forum software by © MyBB