The best way to use magic_quotes in PHP is this:
<?php
if (get_magic_quotes_gpc()) {
die("magic_quotes must be turned off.");
}
?>
![]() |
|
||||||||||
|
Why not to use Magic Quotes
Why not to use Magic Quotes
Roland Illig
12-Oct-2007 12:35
The best way to use magic_quotes in PHP is this:
rjh at netcraft dot com
13-Jun-2007 02:50
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().
gerard at modusoperandi dot com dot au
13-May-2007 09:53
Apparently it will be removed in PHP 6:
11-Feb-2006 01:47
It is also important to disable Magic Quotes while in development enivronment. For the reasons mentioned above, not everybody is using Magic Quotes. |