Edit report at http://bugs.php.net/bug.php?id=26004&edit=1
ID: 26004
Comment by: mzbirka at centrum dot cz
Reported by: jacknorton101 at hotmail dot com
Summary: $_POST variables not set when using
enctype="multipart/form-data"
Status: No Feedback
Type: Bug
Package: *General Issues
Operating System: RedHat Linux 9
PHP Version: 4.3.3
Block user comment: N
Private report: N
New Comment:
Just for the record, in my case similar behavior was observed and the
cause was
restrictions in the suhosin - hardened debian distribution,
suhosin.post.max_name_length specifically.
Previous Comments:
------------------------------------------------------------------------
[2010-02-13 12:57:31] sudeshkmr at yahoo dot com
I faced the same problem and nothing worked. I have tested on Apache
2.2, PHP 5.3 on Windows Vista. I also tested on Ubuntu (Karmic) with
Apache 2.2 and PHP 5.3. I also tested with nGinX 0.8 and PHP 5.3.
Then I found a workaround. The action="" parameter should not be the
script page itself on which you have file upload form. For example, you
have a page index.php with the upload form.
<form action="upload.php" enctype="multipart/form-data" method="post">
<input type="hidden" name="MAX_FILE_SIZE" value="200000">
<input type="file" size="40" name="upload">
<input type="submit" value="Upload">
</form>
The action="upload.php" <-------- This page has to be different than the
file upload form page, and it works on all configurations of PHP!
Do not use <php?=$_SERVER['PHP_SELF']?> for the action parameter.
------------------------------------------------------------------------
[2010-02-03 16:17:33] gimi dot alb at gmail dot com,
Some Apache hosts have problem parsing variables from .htaccess files.
They do not throw any error, but they just unset the variables.
I had the problem with the POST variable not being set, when I migrated
to a new host. After hours of debugging, I found out that
these variables:
#php_value upload_max_filesize 50M
#php_value post_max_size 55M
#php_value memory_limit 384M
were causing the webserver to set the memory limit to 256K and POST
variable not working.
So I commented them out and insted used php.ini to set the variables.
It worked fine after that.
------------------------------------------------------------------------
[2009-09-10 10:53:46] just at helping dot com
IT IS NOT a BUG. GET and post methods will work as normal requests but
if you use the form enctype multipart then you got to handle the request
as multipart. In java I use the oreilly MultipartRequest to parse the
data and it works wonderfully. You migh thave to find a way to get it in
PHP or you can write yourself a multipartrequest class based on
oreilly's one.
------------------------------------------------------------------------
[2009-07-01 16:22:26] shaharjourno at hotmail dot com
Hi I had the same bug i found a solution please check your
Post_max_SIZE. there are some problems with some sizes. I managed to
create this problem and then solved
Here is a link with some examples
http://forums.devnetwork.net/viewtopic.php?f=31&t=94754
Hopefully it will help .
------------------------------------------------------------------------
[2009-01-20 14:31:40] paraporquerias at yahoo dot com
My problem is that, in my earlier php instalation, I had
register_globals=on, and now, with PHP5, it comes off by default:
http://cn.php.net/manual/en/language.variables.external.php
My solution was using this line before I need the value of $username
$username = echo $_POST['username'];
I hope it helps...
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/bug.php?id=26004
--
Edit this bug report at http://bugs.php.net/bug.php?id=26004&edit=1