backwards compat for newly developed scripts ($_GET / $HTTP_GET_VARS)
| From: | Paul Nicholson | Date: | Wed, 02 Oct 2002 01:11:12 +0000 |
| Subject: | backwards compat for newly developed scripts ($_GET / $HTTP_GET_VARS) | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-118488@lists.php.net to get a copy of this message | ||
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hey gang,
I've been wondering about developing scripts that the end-user might run on
php < 4.1.0. I've heard allot of ways except for one that I recently thought
of.
How about using:
- ----
if(!isset($_GET)) { global $HTTP_GET_VARS; $_GET = &$HTTP_GET_VARS; }
- ----
? That allows you to use $_GET as if you were using the new versions and it
only requires one line....and doesn't depend on the new versions to have
$HTTP_*_VARS. It also works for the other vars(POST, SESSION, etc).
~Paul
- --
~Paul Nicholson
Design Specialist @ WebPower Design
"The web....the way you want it!"
paul@webpowerdesign.net
"It said uses Windows 98 or better, so I loaded Linux!"
Registered Linux User #183202 using Register Linux System # 81891
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org
iD8DBQE9mke1DyXNIUN3+UQRAikLAJ9qEoMoEdhdqE3RF8owBSlvg0CJSwCdH8Wi
LYepO02gxAoY09Sld2x2m6M=
=7FF4
-----END PGP SIGNATURE-----