Hi Geeks, Here is code below, I wrote for multi file upload. This form takes a numeric value from previous page and print required form fields on this page. But when I write php code for upload it gives me errors. I use print_r($_FILES); but it returns an empty array(). Please help me how can I process this multi file form and store it into database. Give me php code for this form.
<?php
$fileValue = $_POST['field'];
?>
<body>
<form action="final.php" method="post" enctype="multipart/form-data" name="final">
<input name="total" type="hidden" value="<?php echo $fileValue; ?>" />
<?php
for($counter = 1; $counter <= $fileValue; $counter++){
?>
Song Name:
<input type="text" name="song_name[]" /><br />
Artist:
<input type="text" name="artist[]" /><br />
File:
<input type="file" name="file[]" /><br />
<?php
}
?>
<input type="submit" name="submit" value="Submit" />
</form>