note 86642 added to security.globals
| From: | georg_gruber at yahoo dot com | Date: | Mon, 27 Oct 2008 21:21:47 +0000 |
| Subject: | note 86642 added to security.globals | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-145849@lists.php.net to get a copy of this message | ||
BEWARE of using register_globals = On, it's not only bad karma but highly dangerous.
Consider the following coding:
<?php
// assume $_SESSION['user'] = array('Hello', 'World');
// assume session_start() was called somewhere before.
print('<pre>Contents of array $_SESSION[\'user\']');
print_r($_SESSION['user']);
print('<hr>Contents of array $user (PHP SETUP register_globals = On)');
print_r($user);
print('</pre>');
?>
If you manipulate $user you'll manipulate $_SESSION['user'] as well with PHP SETUP
register_globals = On.
So please avoid it at any cost, no serious programmer would ever want to have register_globals = On.
----
Server IP: 81.223.48.75
Probable Submitter: 86.32.238.19
----
Manual Page -- http://www.php.net/manual/en/security.globals.php
Edit -- https://master.php.net/note/edit/86642
Del: integrated -- https://master.php.net/note/delete/86642/integrated
Del: useless -- https://master.php.net/note/delete/86642/useless
Del: bad code -- https://master.php.net/note/delete/86642/bad+code
Del: spam -- https://master.php.net/note/delete/86642/spam
Del: non-english -- https://master.php.net/note/delete/86642/non-english
Del: in docs -- https://master.php.net/note/delete/86642/in+docs
Del: other reasons-- https://master.php.net/note/delete/86642
Reject -- https://master.php.net/note/reject/86642
Search -- https://master.php.net/manage/user-notes.php