note 69380 deleted from function.get_magic_quotes_gpc by nlopess
| From: | nlopess@php.net | Date: | Tue, 04 Sep 2007 11:52:59 +0000 |
| Subject: | note 69380 deleted from function.get_magic_quotes_gpc by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-130155@lists.php.net to get a copy of this message | ||
Note Submitter: TerrorKalle at Clantemplates dot com
----
I found this very useful if u want to addslashes for all input when construcing a page...
<?php
$check = Array(
'_POST', '_FILES', '_GET', '_REQUEST',
'_COOKIE', '_SESSION'
);
foreach($check as $arr)
{
$i = 0;
foreach($$arr as $inp)
{
if(!get_magic_quotes_gpc())
{
$keys = array_keys(${$arr});
${$arr}[$keys[$i]] = addslashes($inp);
++$i;
}
}
$i = 0;
}
?>