A
Anonymous
Guest
try this ..
# <form method=post action=products.php>
# <input name="file[]" type="text">
# .
# .
# .
# .
# <input name="file[]" type="text">
# ?>
//now in php it will already be and array
if you echo $file = $_POST['file']; you will get an array.
so do a foreach on $file...
my example.
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="POST" enctype="multipart/form-data">
Name:<input type="text" name="name[]" value="firstname"/>
Name 2:<input type="text" name="name[]" value="Lastname" />
<input type="submit" value="submit" />
</form>
<?php
$name = $_POST['name'];
foreach($name as $names){
echo "$names<br>";
}
out up was
firstname
Lastname
# <form method=post action=products.php>
# <input name="file[]" type="text">
# .
# .
# .
# .
# <input name="file[]" type="text">
# ?>
//now in php it will already be and array
if you echo $file = $_POST['file']; you will get an array.
so do a foreach on $file...
my example.
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="POST" enctype="multipart/form-data">
Name:<input type="text" name="name[]" value="firstname"/>
Name 2:<input type="text" name="name[]" value="Lastname" />
<input type="submit" value="submit" />
</form>
<?php
$name = $_POST['name'];
foreach($name as $names){
echo "$names<br>";
}
out up was
firstname
Lastname