Re: Curious Problem with $_POST
| From: | itoctopus | Date: | Tue, 10 Apr 2007 01:56:23 +0000 |
| Subject: | Re: Curious Problem with $_POST | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-252391@lists.php.net to get a copy of this message | ||
You should check $_FILES, and your form tag should be like this
<form action='yoursubmitfile' method='post'
enctype='multipart/form-data'>
--
itoctopus - http://www.itoctopus.com
"Stephen" <stephen-d@rogers.com> wrote in message
news:461AE016.7050606@rogers.com...
> I have a form for uploading files. It is intended to upload photos. I
> have it listed at the end.
>
> When I upload a jpg everything is fine. The $_POST variable is populated
> as expected.
>
> If I upload a zip file, it is empty!
>
> print_r ($_POST); gives
>
> Array ( )
>
> If I upload a jpg Print_r gives:
>
> Array ( [form] => uploadimagesform [MAX_FILE_SIZE] => 100000 [category]
> => 1 [photo_caption] => Array ( [0] => [1] => [2] => [3] => ) [submit]
> => Add Photos )
>
> I am at a total loss to understand this, and don't know where to begin.
>
> Help!
>
> Thanks in advance
> Stephen
>
> <form enctype="multipart/form-data" action="up.php"
> method="post"
> name="upload_form"><br />
> <input name="form" type="hidden" value="uploadimagesform"
> />
> <label for="category">Select Category</label>
> <select id="category" name="category">
> <option value=1>Name</option>
> <option value=2>Purple</option>
> </select><br /><br />
> <label for="Photo1">Photo 1:</label>
> <input id="photo_filename[]" name="photo_filename[]"
> type="file"
> /><br />
> <label for="Caption1">Caption: </label>
> <textarea id="photo_caption[]"
> name="photo_caption[]"></textarea><br
> /><br />
> <label for="Photo2">Photo 2:</label>
> <input id="photo_filename[]" name="photo_filename[]"
> type="file"
> /><br />
> <label for="Caption2">Caption: </label>
> <textarea id="photo_caption[]"
> name="photo_caption[]"></textarea><br
> /><br />
> <label for="Photo3">Photo 3:</label>
> <input id="photo_filename[]" name="photo_filename[]"
> type="file"
> /><br />
> <label for="Caption3">Caption: </label>
> <textarea id="photo_caption[]"
> name="photo_caption[]"></textarea><br
> /><br />
> <label for="Photo4">Photo 4:</label>
> <input id="photo_filename[]" name="photo_filename[]"
> type="file"
> /><br />
> <label for="Caption4">Caption: </label>
> <textarea id="photo_caption[]"
> name="photo_caption[]"></textarea><br
> /><br />
> <input type="submit" name="submit" value="Add Photos"
> />
> </form>