#26004 [Com]: $_POST variables not set when using enctype="multipart/form-data"
| From: | paraporquerias at yahoo dot com | Date: | Tue, 20 Jan 2009 14:31:43 +0000 |
| Subject: | #26004 [Com]: $_POST variables not set when using enctype="multipart/form-data" | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-133066@lists.php.net to get a copy of this message | ||
ID: 26004
Comment by: paraporquerias at yahoo dot com
Reported By: jacknorton101 at hotmail dot com
Status: No Feedback
Bug Type: *General Issues
Operating System: RedHat Linux 9
PHP Version: 4.3.3
New Comment:
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...
Previous Comments:
------------------------------------------------------------------------
[2008-12-15 02:28:26] ray_linn at hotmail dot com
occurs the same issues on apache 2.2.8 + latest php 5.2.8, all of the
solution above is useless.
------------------------------------------------------------------------
[2008-09-16 01:58:06] mike dot dygert at adelphia dot net
I am having this issue, none of the above worked for me... anybody have
other ideas? (IIS 6, PHP 5.2.6)
Thanks
------------------------------------------------------------------------
[2008-03-05 14:56:13] schefer at webdessert dot ch
To correct my above message:
Post the form with method GET does not work, setting the post_max_size
in php.ini higher than the size of the uploaded file did the trick.
------------------------------------------------------------------------
[2008-03-05 14:43:40] schefer at webdessert dot ch
I have experienced the same problems with PHP 5.2.4 on Windows. The
solution was to specify the forms method as GET, and not as POST. It
worked as well by not specifying any method, as this will choose GET as
the default method.
Use it like this:
<form action="myFile.php" enctype="multipart/form-data"
method="GET">
<input type="hidden" name="foo" value="bar" />
<input type="file" name="file" />
<input type="submit" value="Upload" />
</form>
print_r($_GET) results in:
Array ( [foo] => bar [file] => abc.zip )
------------------------------------------------------------------------
[2008-02-12 13:42:05] sri dot www at gmail dot com
I am facing the similar problem. when i upload a file having more than
the size specified in post_max_size variable, the $_POST variables are
empty after form submission. If i increase the post_max_size variable
more than the file trying to be uploaded then i can get the $_POST
variables array.
Is there any other way to fix this without relaying php configuration
variables in order to get the $_POST variables as it is?
------------------------------------------------------------------------
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/26004
--
Edit this bug report at http://bugs.php.net/?id=26004&edit=1