[PHP] Predefined variables in PHP 4.2 vs. older version

2002-04-25 Thread Pekka Saarinen

http://www.php.net/manual/en/language.variables.predefined.php says:

--
In PHP 4.2.0 and later, the default set of predefined variables which are 
available in the global scope has changed. Individual input and server 
variables are by default no longer placed directly into the global scope; 
rather, they are placed into the following superglobal arrays.
You can still force the old behaviour by setting register_globals to 'On' 
in your php.ini file.
--

Changing php.ini is not an option in most virtual servers.

Is there a way to reliably detect PHP version and have $PHP_SELF replaced 
with $_SERVER['PHP_SELF']  when executed in 4.2 or newer?

This way I would avoid putting out separate versions for PHP 4.2 or newer.

Thanks,

Pekka
http://photography-on-the.net/ee/






-
Pekka Saarinen
http://photography-on-the.net
-




RE: [PHP] Predefined variables in PHP 4.2 vs. older version

2002-04-25 Thread Ford, Mike [LSS]

 -Original Message-
 From: Pekka Saarinen [mailto:[EMAIL PROTECTED]]
 Sent: 25 April 2002 11:05
 
 Is there a way to reliably detect PHP version and have 
 $PHP_SELF replaced 
 with $_SERVER['PHP_SELF']  when executed in 4.2 or newer?

What about:

if (isset($_SERVER)) $PHP_SELF = $_SERVER['PHP_SELF'];

Cheers!

Mike

-
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning  Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php