php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #10533 empty POST variables when file uploads disabled
Submitted: 2001-04-27 23:08 UTC Modified: 2001-06-15 10:57 UTC
From: nolan at peaceworks dot ca Assigned:
Status: Closed Package: Variables related
PHP Version: 4.0.4pl1 OS: Windows 2000 Server
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: nolan at peaceworks dot ca
New email:
PHP Version: OS:

 

 [2001-04-27 23:08 UTC] nolan at peaceworks dot ca
I'm not sure if this is a bug or a feature, but I came across it while thinking that having GET and POST variables together were causing a problem. Turns out it was POST variables not being passed when file uploads were disabled and the enctype was multipart. Here's my synopsis:

If I have these two files....

testform.php:
<form action="testout.php?q=1" method="post">
<input type="text" name="f">
<input type="submit">
</form>

and testout.php:
<?
echo "q: $q<br>";
echo "f: $f<br>";
?>

then, say I request testform.php in a browser and type "hello" in the field. I get back this when I submit...

q: 1 
f: hello

looks good so far, but if I then change the form to look like this:

<form action="testout.php?q=1" method="post" enctype="multipart/form-data">

then I re-request the page and type "hello" in the field, and submit...I get this:

q: 1 
f: 

*oops*...looks like the multipart/form-data encoding type makes the form variables go away. Interesting...but changing the POST to a GET seems to work. What if I don't want the variables in the query string, though?

I check the php.ini and discover that file uploads are disabled. I enable file uploads and voila! it works!!! now I get...

q: 1 
f: hello

regardless of whether I use POST or GET. Since file uploads were disabled, I assumed that file widgets would not be allowed to pass data, but I didn't think that having a form with multipart/form-data as the encoding type would disable POSTing in general when file uploads were disabled. 

So...is it a feature, or is it a bug?

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-06-15 10:57 UTC] sniper@php.net
With PHP 4.0.6RC3 this works just fine for me.
(should work with 4.0.5 too as the code in question hasn't changed)


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 28 10:01:29 2024 UTC