On Mon, Jun 24, 2002 at 09:24:13PM +0100, Peter wrote: > If you want an all in one solution without having to have two versions, > can't you read the status of register_globals from the config file and base > the rest of the script on this? > eg > if (register_globals == 'on') { > $name = _POST['name']; > $address = _GET['address']; > } > > then you can access the variables as if register_globals = on even if it > isn't
That's the type of solution that I took on one of our servers where I had deliberately turned off register_globals (prior to PHP 4.1 or whenever the default was changed), though I just used a loop: foreach($HTTP_POST_VARS as $var => $val) { $$var = $val; } // repeat for the other relevant $HTTP_*_VARS The result was a short script that could be require_once'd at the top of every script that depended on register_globals being off. > "Simon Troup" <[EMAIL PROTECTED]> wrote in message > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > > I've written a small freeware script that gets installed on a variety of > > different platforms running various PHP versions. > > > > I've read through the manual about the super global arrays and how post > and > > get vars are no longer registered by default, but am confused about when > it > > would be a good idea to "upgrade" the script. > > > > If I change everything in the script and use $_GET and $_POST etc. then > > those people who are still using earlier versions won't be able to > upgrade. > > > > Does anyone know what the uptake of the latest version is? What is > everyone > > else doing about this? If I were developing for one client it wouldn't be > a > > problem as obviously you'd know what you were developing for. > > > > I'd just like some feedback on when would be a good time to upgrade the > > scripts while causing the minimum disruption and maintaining maximum happy > > users. > > > > Thanks > > > > Zim > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php -- James Clifford [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php