Re: Is this a Bug? HTTP_POST_VARS weirdness in PHP4.03/4.04

From: Date: Fri, 03 Nov 2000 14:22:03 +0000
Subject: Re: Is this a Bug? HTTP_POST_VARS weirdness in PHP4.03/4.04
References: 1  Groups: php.windows 
Request: Send a blank email to php-windows+get-3675@lists.php.net to get a copy of this message
Yeah I had the same problem actually I think what I did was to find all the Instances of isset($http_post_vars) and add the name of at least one of the variables you wanted to check for being set like isset($HTTP_POST_VARS['name']) well still requires changing but its closer to the original and has some backward compatibility... ----- Original Message ----- From: "Ignatius Teo" <iteo@scu.edu.au> To: <php-windows@lists.php.net> Sent: Thursday, November 02, 2000 6:55 AM Subject: [PHP-WIN] Is this a Bug? HTTP_POST_VARS weirdness in PHP4.03/4.04 > Hi, > > I was wondering if anyone else is experiencing the same problem. > I have upgraded from 4.02 to 4.03pl1 and now my forms are broken. > > I have a script structure like so: > > <?php > // some function declarations and includes go here > > // script mainline > // was form submitted? > if (isset($HTTP_POST_VARS)) { > if (!$retval = validate_form($HTTP_POST_VARS)) { > // Houston, we have a problem... > print $retval["errmsg"]; > } else { > // poke data into database & display confirmation/error > $postval = postData($retval["postData"]); > print $postval["errmsg"]; > } > } else { > // display the form > print input_form(); > } > ?> > > For some strange reason, php4.03 (& 4.04dev) seems to think that $HTTP_POST_VARS is set, the first time the page is called. It never ever drops into the else condition on the first call. > > Using if ($REQUEST_METHOD=="POST") allows me to get around the problem for now, but that means changing a whole swag of scripts. > > Can anyone explain to me why this behaviour has changed? Or is it a bug? > > Thanks. > > > Ignatius Teo > G2 Project Manager > Web Development & Online Technologies Group > Snail: Information Technology Directorate > Southern Cross University > PO Box 157, Lismore NSW 2480 > Voice: +61 2 6620-3221 > Fax : +61 2 6620-3033 > Email:iteo@scu.edu.au >

« previous php.windows (#3675) next »