note 60615 added to security.globals
| From: | raphael at er-solution dot de | Date: | Thu, 12 Jan 2006 12:52:40 +0000 |
| Subject: | note 60615 added to security.globals | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-101622@lists.php.net to get a copy of this message | ||
I found something very interessting. That method puts a "$_POST", "$_GET", ....
in front of your var :)
<?php
/*
If Register_Globals=off an your code is already typed for Register_Globals=on, include that
function
*/
function globals_off ()
{
if (!ini_get('register_globals'))
{
h$types_to_register =
array('GET','POST','COOKIE','SESSION','SERVER');
foreach ($types_to_register as $type)
{
if (@count(${'HTTP_' . $type . '_VARS'}) > 0)
{
extract(${'HTTP_' . $type . '_VARS'}, EXTR_OVERWRITE);
}
}
}
}
?>
----
Manual Page -- http://www.php.net/manual/en/security.globals.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+60615
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+60615&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+60615&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+60615&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+60615&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+60615&report=yes&reason=non-english
Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+60615&report=yes&reason=already+in+docs
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+60615&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+60615&report=yes
Search -- http://master.php.net/manage/user-notes.php