Re: Problem with new variable system in 4.2
| From: | Philip Olson | Date: | Sun, 12 May 2002 18:25:32 +0000 |
| Subject: | Re: Problem with new variable system in 4.2 | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-97234@lists.php.net to get a copy of this message | ||
> In php4.1.1 it worked fine. Now I changed the first function to:
> $PATH_INFO = $_SERVER[REQUEST_URI]; (was $PATH_INFO in 4.1.1)
$PATH_INFO worked fine because register_globals was on
which essentially created $PHP_INFO from $_SERVER['PHP_INFO']
so how about you do this:
if (!ini_get('register_globals')) {
extract($HTTP_SERVER_VARS);
}
So if register_globals = off, $PHP_INFO will exist as will
all web server predefined variables, like $DOCUMENT_ROOT.
If you are unsure what predefined variable to use, make
a call to phpinfo() and it'll show you exactly what is
available to the script. And print_r() will also be helpful
for various activities too.
Regards,
Philip Olson