Re: returning the index number part2

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Robert Cummings wrote:
On Tue, 2007-06-05 at 17:16 +0100, blueboy wrote:
if I have an array of  3  images

<table class="signup_table">
<tr>
<td> 1.</td>
<td><input name="userfile[]" type="file"></td>
</tr>
<tr>
<td> 2.</td>
<td><input name="userfile[]" type="file"></td>
</tr>
<tr>
<td>3.</td>
<td><input name="userfile[]" type="file">
</td>
</tr>
</table

How do I access the filename? Like this?

echo $fileName1 = $_FILES['userfile']['name'][0];
echo $fileName2 = $_FILES['userfile']['name'][1];
echo $fileName3 = $_FILES['userfile']['name'][2];

No, like this:

    echo $fileName1 = $_FILES['userfile'][1]['name'];
    echo $fileName2 = $_FILES['userfile'][2]['name'];
    echo $fileName3 = $_FILES['userfile'][3]['name'];

Cheers,
Rob.
I suggest to the op that they use print_r() on $_FILES and all will be revealed

--
Jim Lucas

   "Some men are born to greatness, some achieve greatness,
       and some have greatness thrust upon them."

Twelfth Night, Act II, Scene V
    by William Shakespeare

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux