RE: [PHP-DB] register_globals=on
| From: | Rasmus Lerdorf | Date: | Mon, 26 May 2003 20:43:42 +0000 |
| Subject: | RE: [PHP-DB] register_globals=on | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-28054@lists.php.net to get a copy of this message | ||
On Mon, 26 May 2003, Peter Lovatt wrote:
> Always code using $_GET, $_POST etc - its more secure and better practice.
>
> neat bit of code from the php site which converts older versions of php to
> the new standard
>
> if (!isset($_SERVER))
> {
> $_GET = &$HTTP_GET_VARS;
> $_POST = &$HTTP_POST_VARS;
> $_ENV = &$HTTP_ENV_VARS;
> $_SERVER = &$HTTP_SERVER_VARS;
> $_COOKIE = &$HTTP_COOKIE_VARS;
> $_REQUEST = array_merge($_GET, $_POST, $_COOKIE);
> $_FILES = &$HTTP_POST_FILES;
>
> }
>
> You will find an explanation on php.net at
That's a rather bad way of doing things. I leave "S" out of my
variabes_order for performance reasons, for example. So I am not going to
have $_SERVER set and that doesn't tell you anything about my php version.
-Rasmus