lajkonik86 wrote:Instead of taking care of all the user input in a foreach loop on the $POST array
Since $POST is an array, you can also use any of the array functions on it, such as [man]array_walk[/man]; eliminate the need for an explicit loop.
But yeah, as NogDog points out, not everything in the $POST array would need to be sanitised for database input, since not everything in the $POST array goes into the database (how often do you need to record the value of the submit button?)
As bradgrafelman notes, magic_quotes was invented to do exactly what you're asking; but it's for the reasons given by NogDog that magic_quotes is being removed for PHP 6.