RE: [PHP-DB] register_globals=on
| From: | Peter Lovatt | Date: | Mon, 26 May 2003 20:11:34 +0000 |
| Subject: | RE: [PHP-DB] register_globals=on | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-28053@lists.php.net to get a copy of this message | ||
Hi
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
http://uk.php.net/variables.predefined
HTH
Peter
-----Original Message-----
From: Doug Thompson [mailto:dthompson@brickbarn.com]
Sent: 26 May 2003 20:36
To: Alain Barthlemy; php-db
Subject: Re: [PHP-DB] register_globals=on
Alain:
You can and, in my opinion, should start coding with the register variables
now. That way, when your isp come to their senses and set
register_globals=off, you'll have no changes remaining. If you happen to
miss one or two, they will be easy to find and fix in very little time.
Bon chance,
Doug
On Mon, 26 May 2003 21:06:23 +0200, Alain Barthlemy wrote:
>Hello,
>
>My outside Web-server uses PHP-4.3.X but with register_globals=on in
>php.ini. They will comment this line some day thus I'll have to change
>all parts (not too many luckily) where I use posted variables (change
>$variable -> $_POST['variable']).
>
>Can anyone advice a way to prepare the change? Sorry if it is in the
>PHP-DB list but my main work concerns PHP with MySQL.
>
>Thank You,
>
>--
>Alain Barthlemy
>cassandre@bartydeux.be
>http://bartydeux.be
>Linux User #315631
>
>
>--
>PHP Database Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
>
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php