Ask a Question related to PHP Development, Design and Development.
-
jacknorton101 at hotmail dot com #1
#26004 [NEW]: $_POST variables not set when using enctype="multipart/form-data"
From: jacknorton101 at hotmail dot com
Operating system: RedHat Linux 9
PHP version: 4.3.3
PHP Bug Type: *General Issues
Bug description: $_POST variables not set when using enctype="multipart/form-data"
Description:
------------
The following code works in my local development environment (Win ME,
Apache 1.3.2, PHP 4.3.2) but not on my host (RedHat 9, Apache 2.0.4, PHP
4.3.3).
None of the form inputs defined after the <input type="file" size="40"
name="userfile"> line are set in $_POST (all of those appearing before
are). Therefore $_POST['submitimage'] does not get set.
If I take out enctype="multipart/form-data", or replace it with
"multipart/mixed" the $_POST variables are set, but the file is not
available.
The following php.ini directives are identical in both the local and host
environments:
File_Uploads = On
Upload_Max_Filesize = 2M
Upload_Tmp_Dir = (default)
Post_Max_Size = 8M
In my local environment Register_Globals is Off, and the host environment
has them on.
I have searched previous bug reports, and though I have seen similar
problems, they all seem to be closed and rectified some time (over a year)
ago, but my host is on release 4.3.3 - i.e. later than my dev
environment.
Thanks in anticipation, Jack.
Reproduce code:
---------------
.....
if(!isset($_POST['submitimage']))
{....
<form action="<?=$_SERVER['PHP_SELF']?>" enctype="multipart/form-data"
method="post">
<input type="text" maxlength="60" size="40" name="caption">
<input type="file" size="40" name="userfile">
<input type="hidden" name="MAX_FILE_SIZE" value="2000000">
<input type="submit" name="submitimage" value="Submit">
<input type="reset" value="Reset">
<input type="button" onClick="window.close();" name="noaction" value="No
Action">
</form>
.....
<?php
}
elseif('Submit'==$_POST['submitimage'])
{ //process file ....
Expected result:
----------------
I would expect the $_POST variables to be set, for example
$_POST['submitimage'] should be set and allow the elseif clause to
execute.
Actual result:
--------------
Only the $_POST variables defined in lines above the line:
<input type="file" size="40" name="userfile"> get set. The ones below,
including $_POST['submitimage'] do not get set.
--
Edit bug report at [url]http://bugs.php.net/?id=26004&edit=1[/url]
--
Try a CVS snapshot (php4): [url]http://bugs.php.net/fix.php?id=26004&r=trysnapshot4[/url]
Try a CVS snapshot (php5): [url]http://bugs.php.net/fix.php?id=26004&r=trysnapshot5[/url]
Fixed in CVS: [url]http://bugs.php.net/fix.php?id=26004&r=fixedcvs[/url]
Fixed in release: [url]http://bugs.php.net/fix.php?id=26004&r=alreadyfixed[/url]
Need backtrace: [url]http://bugs.php.net/fix.php?id=26004&r=needtrace[/url]
Try newer version: [url]http://bugs.php.net/fix.php?id=26004&r=oldversion[/url]
Not developer issue: [url]http://bugs.php.net/fix.php?id=26004&r=support[/url]
Expected behavior: [url]http://bugs.php.net/fix.php?id=26004&r=notwrong[/url]
Not enough info: [url]http://bugs.php.net/fix.php?id=26004&r=notenoughinfo[/url]
Submitted twice: [url]http://bugs.php.net/fix.php?id=26004&r=submittedtwice[/url]
register_globals: [url]http://bugs.php.net/fix.php?id=26004&r=globals[/url]
PHP 3 support discontinued: [url]http://bugs.php.net/fix.php?id=26004&r=php3[/url]
Daylight Savings: [url]http://bugs.php.net/fix.php?id=26004&r=dst[/url]
IIS Stability: [url]http://bugs.php.net/fix.php?id=26004&r=isapi[/url]
Install GNU Sed: [url]http://bugs.php.net/fix.php?id=26004&r=gnused[/url]
Floating point limitations: [url]http://bugs.php.net/fix.php?id=26004&r=float[/url]
jacknorton101 at hotmail dot com Guest
-
#40281 [NEW]: form with enctype="multipart/form-data" doesn't work
From: hongying4 at yahoo dot ca Operating system: windows 2003 PHP version: 5.2.1RC4 PHP Bug Type: Apache2 related Bug... -
enctype="multipart/form-data"
I created a form with <input type="file"> and on the action page I put: <CFFILE ACTION="Upload" FILEFIELD="path"... -
#26004 [Opn->Fbk]: $_POST variables not set when using enctype="multipart/form-data"
ID: 26004 Updated by: moriyoshi@php.net Reported By: jacknorton101 at hotmail dot com -Status: Open +Status: ... -
Using <form ... enctype="multipart/form-data">
I am using an upload util and I was told I need this option, enctype="multipart/form-data", in my FORM tag. How do I reference the other form... -
enctype="multipart/form-data" is screwing up the form variables
In article <25514fc4.0307050937.7f801e8b@posting.google.com>, dhoult@landair.com (Daniel) wrote: If you correct the spelling of "method" does...



Reply With Quote

