According to the PHP manual , in order to make the code more portable, they recommend using something like the following to escape data:
if (!get_magic_quotes_gpc()) { $lastname = addslashes($_POST['lastname']); } else { $lastname = $_POST['lastname']; }
I have other validation checks that I will perform, but how safe is it strictly in terms of getting out of the data? I also saw that magic quotes will deprecate in PHP 6. How will this affect the above code? I would prefer not to rely on a database-specific escaping function like mysql_real_escape_string ().
security php magic-quotes
VirtuosiMedia Oct 21 '08 at 0:50 2008-10-21 00:50
source share