|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-03-02 04:14 UTC] derick@php.net
[2004-03-02 12:26 UTC] sean@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 05:00:01 2025 UTC |
Description: ------------ when I use a form with all input-fields named e.g. "foo[]" the fields after an input-file-field will be lost in the $_POST var. Reproduce code: --------------- <html> <head></head> <body> <form method="post" enctype="multipart/form-data" action="<?= $_SERVER['PHP_SELF'] ?>"> <input name="foo[]" type="text"><br> <input name="foo[]" type="file"><br> <input name="foo[]" type="file"><br> <input name="foo[]" type="text"><br> <input type="submit" value="go"><br> </form> <pre> <? if (count($_POST)>0) { print_r($_POST); print_r($_FILES); } ?> </pre> </body> </html> Expected result: ---------------- Array ( [foo] => Array ( [0] => bar1 [1] => bar2 ) ) Array ( [foo] => Array ( [name] => Array ( [0] => file1 [1] => file2 ) ...SKIP... Actual result: -------------- Array ( [foo] => Array ( [0] => bar1 ) ) Array ( [foo] => Array ( [name] => Array ( [0] => file1 [1] => file2 ) ...SKIP...