|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2000-07-26 20:24 UTC] zak@php.net
[2000-08-06 00:16 UTC] zak@php.net
[2000-08-18 18:40 UTC] sniper@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Dec 21 03:00:01 2025 UTC |
As Manual .... ============================================================ Example 18-2. Uploading multiple forms 1 2 <form action="file-upload.html" method="post" enctype="multipart/form-data"> 3 Send these files:<br> 4 <input name="userfile[]" type="file"><br> 5 <input name="userfile[]" type="file"><br> 6 <input type="submit" value="Send files"> 7 </form> 8 When the above form is submitted, the arrays $userfile, $userfile_name, and $userfile_size will be formed in the global scope (as well as in $HTTP_POST_VARS). Each of these will be a numerically indexed array of the appropriate values for the submitted files. For instance, assume that the filenames /home/test/review.html and /home/test/xwp.out are submitted. In this case, $userfile_name[0] would contain the value review.html, and $userfile_name[1] would contain the value xwp.out. Similarly, $userfile_size[0] would contain review.html's filesize, and so forth. ============================================================ That's NOT TRUE.... For example , The FORM is.. ============================================================ First - <input type=file name=img[]> Second - <input type=file name=img[]> ============================================================ Script is below... ============================================================ echo count(img) is result 6 NOT 8.... -_-' for ($i = 0;$i<count($img);$i++) { echo img[$i] } is result img[0] = FILE_NAME OF FIRST FILE; img[1] = FILE_TYPE OF FIRST FILE; img[2] = FILE OF FIRST FILE; img[3] = FIE_NAME OF SECOND FILE; img[1] = FILE_TYPE OF SECOND FILE; img[2] = FILE OF SECOND FILE; AND echo img_name[0] is NULL... echo img_size[0] is NULL... echo img_type[0] is NULL... INDEX [1] is too.... What's wrong.....?