I have a form with several input that I create with a for loop, which I pass through POST to another page and change its name as in the example:
<form action="page2.php" method="post">
<?php
for($i=1; $i<=10; $i++){
?>
<select name=fichier<?php echo $i?> > (...)
The problem is if I do not want to fill in the input or select, how do I get its value? To not repeat the code for the various inpuut I have it on the other page that receives the POST.
for($i=1; $i<=10; $i++){
if (isset($_POST['fichier'.$i]))
{
$fichier = htmlentities($_POST['fichier'.$i]);
}
if(isset($_POST['fichier'.$i])== 0){
break;
}
//echo $fichier;
}