Missing posted variables in target script when multipart/form-data is set
| From: | Ed Greenberg | Date: | Fri, 07 Jun 2002 04:32:28 +0000 |
| Subject: | Missing posted variables in target script when multipart/form-data is set | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-101082@lists.php.net to get a copy of this message | ||
I have a small test script which fails when enctype="multipart/form-data" is
set.
<form action="action.php" method="post"
enctype="multipart/form-data">
Your name: <input type="text" name="name">
You age: <input type="text" name="age">
You file: <input type="file" name="myfile">
<input type="submit">
When the above is submitted to action.php, $_POST and $HTTP_POST_VARS are
both empty. If I remove the enctype="multipart/form-data" portion of the
form tag, the arrays are set correctly, and in fact, the global_variables
are created since register_globals is on.
Platform is RedHat Linux 7.3 (Valhalla) with PHP 4.1.2 and Apache 1.3.23 as
installed from RedHat's Valhalla RPMS.
I've seen several postings similar to this, but none of them carried a
solution or even a hint.
I hope I've given enough info.
</edg>
Ed Greenberg
PS: Resolving this would resolve issues that I have with a bunch of popular
PHP packages such as Gallery, Pagetool and phpWebSite. The authors of these
packages all have multipart/form-data on almost all their forms, whether or
not uploading a file is required.