Elizabeth, I have not tested uploading with this code, but it will produce the desired output on your page, and give you the example you requested.
<form enctype=multipart/form-data action=test2.php method=post>
<?PHP
$previously_given_number = 5;
for ($i = 0; $i <=$previously_given_number;$i++)
{
print "<input type=file name=\"userfile[]\"><br>";
print "<input type=hidden name=\"MAX_FILE_SIZE\" value=\"24000\">";
}
?>
<input type=submit value="Send Files">
</form>
Elizabeth wrote:
I was able to find the following code that w
ill allow the user to browse files and send it to the next page for processing.
<form enctype=multipart/form-data action=test2.php method=post>
<input type=file name="userfile[]">
<input type=hidden name=MAX_FILE_SIZE value=24000>
<input type=submit value=" Send File ">
</form>
My questions is how do I create this field dynamically? I would like for a user to enter the number of images they would like to upload in a previous form from the one above and then have the above generated as many times as the number of images the user has to upload. I realize that I will need a loop, but I'm not sure how to implement the syntax with the above html code.
I appreciate any help regarding this matter.