note 57328 added to function.ini-set
| From: | matthatmicgidotcom at osu1 dot php dot net | Date: | Fri, 30 Sep 2005 16:07:09 +0000 |
| Subject: | note 57328 added to function.ini-set | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-96057@lists.php.net to get a copy of this message | ||
As already mentioned, setting register globals will have no affect on your script. For example:
<?php
ini_set('register_globals', 'On'); // This might be '1', can't
recall...
?>
...does nothing since it would have to be done before your script runs. A way to get around this
particular issue is to assign the globals manually:
<?php
foreach ($HTTP_GET_VARS as $key => $value) {
$GLOBALS[$key] = $value; // or: $$key = $value;
}
foreach ($HTTP_POST_VARS as $key => $value) {
$GLOBALS[$key] = $value; // Could also see if $key was already set here
}
?>
----
Manual Page -- http://www.php.net/manual/en/function.ini-set.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+57328
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+57328&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+57328&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+57328&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+57328&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+57328&report=yes&reason=non-english
Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+57328&report=yes&reason=already+in+docs
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+57328&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+57328&report=yes
Search -- http://master.php.net/manage/user-notes.php