note 69380 added to function.get_magic_quotes_gpc
| From: | TerrorKalle at Clantemplates dot com | Date: | Mon, 04 Sep 2006 02:24:00 +0000 |
| Subject: | note 69380 added to function.get_magic_quotes_gpc | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-116647@lists.php.net to get a copy of this message | ||
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;
}
?>
----
Server IP: 193.27.201.10 (proxied: 193.27.201.10 1.0 www1.shellkonto.se:3128 (squid/2.5.STABLE4))
Probable Submitter: 85.224.95.162
----
Manual Page -- http://www.php.net/manual/en/function.get_magic_quotes_gpc.php
Edit -- https://master.php.net/note/edit/69380
Del: integrated -- https://master.php.net/note/delete/69380/integrated
Del: useless -- https://master.php.net/note/delete/69380/useless
Del: bad code -- https://master.php.net/note/delete/69380/bad+code
Del: spam -- https://master.php.net/note/delete/69380/spam
Del: non-english -- https://master.php.net/note/delete/69380/non-english
Del: in docs -- https://master.php.net/note/delete/69380/in+docs
Del: other reasons-- https://master.php.net/note/delete/69380
Reject -- https://master.php.net/note/reject/69380
Search -- https://master.php.net/manage/user-notes.php