Re: Post 4.1.0 PHP

From: Date: Thu, 30 May 2002 14:59:10 +0000
Subject: Re: Post 4.1.0 PHP
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-99932@lists.php.net to get a copy of this message
At 11:35 PM 5/30/2002 +0930, Michael Hall wrote: When I asked I got this response. $types_to_register = array('GET','POST','COOKIE','SESSION','SERVER'); foreach ($types_to_register as $type) {
    $arr = @${'HTTP_' . $type . '_VARS'};
    if (@count($arr) > 0) {
      extract($arr, EXTR_OVERWRITE);
    }
} put that at the of of your scripts and everything will work ok untill you get things moved over. ~kurth
I've been using PHP 4.0.1 for ages now, and have decided to upgrade one of my machines to 4.2.1 and get used to working under the new security arrangements. I understand that older scripts are fully compatible with 4.1.0+, or can be made so with minimal fuss. I am assuming that scripts written using the new $_GET and $_POST (etc) arrays simply won't run under pre-4.1.0 versions of PHP. So, where does this leave us with regard to ISPs that still run older versions of PHP (so that users' scripts won't break)? Is there some way to write code using the new arrays, but that will run under older versions of PHP. Would including something like this at the top of a script work: $_POST = $HTTP_POST_VARS; while inside the code reference is made only to $_POST ? Sorry if this has been covered repeatedly, I've only just rejoined the list after a break from the relentless volume (of great, useful info). TIA --------------------------------
Michael Hall     ninti@ninti.com
-------------------------------- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Kurth Bemis - Network/Systems Administrator, USAExpress.net/Ozone Computer "Jedi business, Go back to your drinks" - Anakin Skywalker, AOTC kurth@usaexpress.net | http://kurth.hardcrypto.com PGP key available - http://kurth.hardcrypto.com/pgp

« previous php.general (#99932) next »