|
Posted by lawrence k on 09/21/07 23:42
On Sep 19, 1:14 pm, lawrence k <lkrub...@geocities.com> wrote:
> On Aug 23, 8:55 am, Jerry Stuckle <jstuck...@attglobal.net> wrote:
>
>
>
> > lawrence k wrote:
> > > On Aug 23, 12:05 am, Jerry Stuckle <jstuck...@attglobal.net> wrote:
> > >> lawrence k wrote:
> > >>> On Aug 22, 11:48 pm, Jerry Stuckle <jstuck...@attglobal.net> wrote:
> > >>>> lawrence k wrote:
> > >>>>> I've a form that starts off like this:
> > >>>>> <form method="post" action="profile.php?
> > >>>>> id=5&formName=my_story_edit.htm" enctype="multipart/form-data">
> > >>>>> <p>Email address:<br />
> > >>>>> <input type="text" name="totalFormInputs[users][5][email_address]"
> > >>>>> value="lawre...@krubner.com" /></p>
> > >>>>> <p>Zip code:<br />
> > >>>>> <input type="text" name="totalFormInputs[users][5][zip_code]"
> > >>>>> value="22902" /></p>
> > >>>>> <p>Personal image:<br />
> > >>>>> <input type="file" name="totalFormInputs[users][5][upload_file]" /></
> > >>>>> p>
> > >>>>> Oddly enough, the "upload_file" has suddenly disappeared from the
> > >>>>> uploaded array. When I hit $totalFormInputs with print_r, this is what
> > >>>>> I get:
> > >>>>> Array
> > >>>>> (
> > >>>>> [users] => Array
> > >>>>> (
> > >>>>> [5] => Array
> > >>>>> (
> > >>>>> [description] => I grew up in New Jersey.
> > >>>>> [email_address] => lawre...@krubner.com
> > >>>>> [zip_code] => 22902
> > >>>>> [time] => 1187380627
> > >>>>> )
> > >>>>> )
> > >>>>> )
> > >>>>> Why is the file input not show up?
> > >>>>> Everything was working fine a month ago, and now it is broke.
> > >>>>> Any help is very much appreciated.
> > >> If the HTML is correct, it should show up in the $_POSTvariable. But
> > >> since it isn't, you have an HTML problem - not a PHP one.
>
> > [bunch of stuff snipped]
>
> > > That's what I would expect. It's bizzare, I get the right results in
> > > $_FILES, but not in $_POST. How is that possible?
>
> > That's right... I shouldn't try to answer at midnight after I've been
> > out with the guys... :-)
>
> > Yes, it goes in the $_FILESarray, not $_POST.
>
> > Once I got some sleep and looked at this again this morning, it was
> > obvious :-). Sorry to steer you down the wrong path.
>
> I'm confused about this. How does one associate an upload with
> database info? In PHP 4, you could have a form that allowed multiple
> form uploads with multiple fields for inputting multiple info:
>
> ----------------
> Caption your images:
>
> 1.) caption input, file input
> 2.) caption input, file input
> 3.) caption input, file input
> 4.) caption input, file input
> -----------------
>
> In PHP 4, with a form like this, you knew which file went with which
> caption, because the whole 2 dimensional array would show up in
> $_POST.
>
> How do you figure out the relationship in PHP5, if the files never
> show up in $_POST? Does PHP 5 restrict you to just uploading one file
> at a time, if you want to caption the file at the same time?
No answers? I'm surprised by this. I assume I'm not the only PHP
programmer allowing people to upload more than one file at a time. I
had an easy enough time in PHP 4 but I can't figure out how to do this
in PHP 5. If an upload file doesn't appear in $_POST, how do you
associate the file info in $_POST?
[Back to original message]
|