db1 wrote:laserlight wrote:If you are unable to change the configuration, then apply stripslashes() conditionally based on get_magic_quotes_gpc(),
On the [man]get_magic_quotes_gpc[/man] page there is example code for adding slashes if the magic quotes setting is on; your would be much the same, except you'd be removing slashes if the setting is off. So in the if() test in that example, you'd remove the "!", and you'd replace "addslashes" with "stripslashes".
And after that, as laserlight says, you'll need to properly escape the input data, in one of the ways he suggested (PDO or mysql_real_escape_string()).