Código PHP:
Ver original
<?php { // recogemos data posteada por el usuario $arr1["prod"] = $_POST["prod"]; $arr1["cant"] = $_POST["cant"]; $arr1["prec"] = $_POST["prec"]; // agregamos la data posteada al array almacenado en la variable de sesion $arrRegs = $_SESSION["arrDetalles"]; else $arrRegs[] = $arr1; } ?> <!-- todo el codigo html --> <form method="POST" action="<?php echo $_SERVER['PHP_SELF']; ?>"> <table> <tr> <td>Producto</td> <td>Cantidad</td> <td>Precio</td> </tr> <?php { echo "<tr>"; echo "<td>".$arrRegs[$i]["prod"]."</td>"; echo "<td>".$arrRegs[$i]["cant"]."</td>"; echo "<td>".$arrRegs[$i]["prec"]."</td>"; echo "</tr>"; } ?> <tr> <td><input type="loQueConvenga" name="prod"></td> <td><input type="loQueConvenga" name="cant"></td> <td><input type="loQueConvenga" name="prec"></td> <td><input type="submit" name="btnAdd" value="Agregar Detalle"></td> </tr> </table> </form>