|
Why not to use Magic Quotes
Code Examples / Notes » security.magicquotes.whynotroland illig
The best way to use magic_quotes in PHP is this: <?php if (get_magic_quotes_gpc()) { die("magic_quotes must be turned off."); } ?> 11-feb-2006 09:47
It is also important to disable Magic Quotes while in development enivronment. For the reasons mentioned above, not everybody is using Magic Quotes. An application that works fine with Magic Quotes enabled may have security problems (ie can be subject to SQL attacks) when distributed. gerard
Apparently it will be removed in PHP 6: http://www.php.net/~derick/meeting-notes.html#magic-quotes rjh
Additionally, addslashes() is not a cure-all against SQL injection attacks. You should use your database's dedicated escape function (such as mysql_escape_string) or better yet, use parameterised queries through mysqli->prepare().
|