I want to build a function in php so that I send a form for each of the values of an array.
Next I put the code that I have made:
function importar () {
$productos = ($_SESSION ['CSVpart']); //El array lo tenemos como variable de sesion.
foreach ($productos as $valor){
$csv = $valor; ?>
<div id="enviarFormCsv">
<form method="POST" action ="POST.php" name="enviaCsv" > <input type
="hidden" name="csv" value="<?php echo $csv ?>"> <input type="submit" value="Confirmar la importación a Prestashop"> </form>
</div> <!--Cierra div EnviaFormCsv.-->
<?php
} //Cierra foreach.
} // Cierra la funcion.
Well, with this code, only the first value of the array is received.
What is needed is to send (and receive) a form for each value of the array