Hi!
I have to do a form that should be used to post some information and (optionally) to upload some files.
When I put the encoding of the form to multipart/form-data I'm able to read the updated files, but I can not access anymore the other input fields of the form as global variables. For example, if the form is:
<form enctype="multipart/form-data" action="send.php" method="post">
<input type="text" name="build" size="20">
<input type="hidden" name="MAX_FILE_SIZE" value="5000000">
<input type="file" name="att" size="19">
<input class="clsButton" type="submit" value="Submit" name="submit">
</form>
I'm not able to read the value of "build".
Do you know how can I read the "build" value without changing the enctype (need to upload files)?
I've been searching for a while, and the only thing that I've found is a comment in the php manual page, saying that when you use multipart/form-data, you should use $HTTP_RAW_POST_DATA to get the value of the variables of your form, but I don't know hot to parse $HTTP_RAW_POST_DATA to get the variables of the form.
Thank you in advance!
Cheers,
forms with upload files and normal input tags
Moderator: General Moderators
For the record, $build was not available anywhere until I changed in php.ini from the default (using php 4.1.2 in a redhat linux 7.3)
file_uploads = Off
to
file_uploads = On
(yes, I know that it looks stupid... but afaik this option is not mentioned in the upload part of the php manual, so it took me a while to find the problem...)
Now I've got all the form variables and my files are uploaded correctly... except when I try from a computer != localhost using IE... I still don't know why it only works from localhost, but I've not yet searched hard enough for a solution.
Thank you for your help!
Cheers,
file_uploads = Off
to
file_uploads = On
(yes, I know that it looks stupid... but afaik this option is not mentioned in the upload part of the php manual, so it took me a while to find the problem...)
Now I've got all the form variables and my files are uploaded correctly... except when I try from a computer != localhost using IE... I still don't know why it only works from localhost, but I've not yet searched hard enough for a solution.
Thank you for your help!
Cheers,