note 112635 added to security.globals
| From: | Anonymous | Date: | Sun, 07 Jul 2013 13:33:47 +0000 |
| Subject: | note 112635 added to security.globals | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-195480@lists.php.net to get a copy of this message | ||
To make older scripts working in 5.4, you can use the following snippet for simulating
register_globals:
<?php
if (substr(phpversion(), 0, 3) == '5.4') {
foreach ($_REQUEST as $key => $value) {
$$key = $value;
}
}
?>
Now configure your Apache (or just use php.ini) - there's a great setting auto_prepend_file to
include your snippet to get executed in front of _every_ php script execution.
<Directory "/var/www/somedir/">
php_value auto_prepend_file /var/www/magicstuff.php
</Directory>
Now you've register_globals back ;)
----
Server IP: 69.147.83.199
Probable Submitter: 77.190.87.118
----
Manual Page -- http://php.net/manual/en/security.globals.php
Edit -- https://master.php.net/note/edit/112635
Del: integrated -- https://master.php.net/note/delete/112635/integrated
Del: useless -- https://master.php.net/note/delete/112635/useless
Del: bad code -- https://master.php.net/note/delete/112635/bad+code
Del: spam -- https://master.php.net/note/delete/112635/spam
Del: non-english -- https://master.php.net/note/delete/112635/non-english
Del: in docs -- https://master.php.net/note/delete/112635/in+docs
Del: other reasons-- https://master.php.net/note/delete/112635
Reject -- https://master.php.net/note/reject/112635
Search -- https://master.php.net/manage/user-notes.php