CodeIgniter Forums
What's wrong with $this->db->insert('comment', $_POST); - 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: What's wrong with $this->db->insert('comment', $_POST); (/showthread.php?tid=9008)



What's wrong with $this->db->insert('comment', $_POST); - El Forum - 06-08-2008

[eluser]EEssam[/eluser]
Hello,

I just finished watching the great CI video tutorials and the guy on the tutorial said that the following line of code should be cleaned for security in real world programming or something like that:

$this->db->insert('comment', $_POST);

Doesn't CI clean the $_POST array automatically? If not, what I should do to safely insert comments using this method (I mean passing the whole array to $this->db->insert)?

Please advise.


What's wrong with $this->db->insert('comment', $_POST); - El Forum - 06-08-2008

[eluser]stuffradio[/eluser]
The user docs answers tons of questions, even ones like this Wink

http://ellislab.com/codeigniter/user-guide/general/security.html