note 71898 added to ref.filter
| From: | vojtech at x dot cz | Date: | Thu, 21 Dec 2006 14:38:04 +0000 |
| Subject: | note 71898 added to ref.filter | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-120829@lists.php.net to get a copy of this message | ||
Also notice that filter functions are using only the original variable values passed to the script
even if you change the value in super global variable ($_GET, $_POST, ...) later in the script.
<?php
echo filter_input(INPUT_GET, 'var'); // print 'something'
echo $_GET['var']; // print 'something'
$_GET['var'] = 'changed';
echo filter_input(INPUT_GET, 'var'); // print 'something'
echo $_GET['var']; // print 'changed'
?>
In fact, external data are duplicated in SAPI before the script is processed and filter functions
don't use super globals anymore (as explained in Filter tutorial bellow, section 'How does
it work?').
----
Server IP: 212.24.129.110
Probable Submitter: 84.42.163.192
----
Manual Page -- http://www.php.net/manual/en/ref.filter.php
Edit -- https://master.php.net/note/edit/71898
Del: integrated -- https://master.php.net/note/delete/71898/integrated
Del: useless -- https://master.php.net/note/delete/71898/useless
Del: bad code -- https://master.php.net/note/delete/71898/bad+code
Del: spam -- https://master.php.net/note/delete/71898/spam
Del: non-english -- https://master.php.net/note/delete/71898/non-english
Del: in docs -- https://master.php.net/note/delete/71898/in+docs
Del: other reasons-- https://master.php.net/note/delete/71898
Reject -- https://master.php.net/note/reject/71898
Search -- https://master.php.net/manage/user-notes.php