Is this a Bug? HTTP_POST_VARS weirdness in PHP4.03/4.04
| From: | Ignatius Teo | Date: | Wed, 01 Nov 2000 22:55:20 +0000 |
| Subject: | Is this a Bug? HTTP_POST_VARS weirdness in PHP4.03/4.04 | ||
| Groups: | php.windows php.windows | ||
| Request: | Send a blank email to php-windows+get-3626@lists.php.net to get a copy of this message | ||
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