Unable to calculate the number of uploaded files
Just copied a section of JavaScript that adds a text box node
But now the appearance of a click "Add another", will add a new Node
I added Echo ' Count (($_files[' img ' [' name ']) to the code after the submission;
Added two files, print out 1, how did not calculate it?
Share to:
------Solution--------------------
Which value is 1, it is recommended to post the code for analysis.
------Solution--------------------
Let's print the next $_files and look at it!
------Solution--------------------
This is your initial control.
img[] "/>
This is the control you attached
Input.setattribute (' name ', ' files[] ');//Set the input node Name property to files[], passed to the server side as an array
This is the control you're dealing with.
$num =count (($_files[' img' [' name '])); Calculate the number of uploaded files
It should be clear, right? A little more careful.