Skip to content

Instantly share code, notes, and snippets.

@ricardosiri68
Last active August 29, 2015 14:12
Show Gist options
  • Save ricardosiri68/99d9f257a2ebd39a243d to your computer and use it in GitHub Desktop.
Save ricardosiri68/99d9f257a2ebd39a243d to your computer and use it in GitHub Desktop.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>form</title>
</head>
<body>
<form action="send.php" method="POST">
<div class="producto">
<input type="" name="productos[0][nombre]">
<input type="" name="productos[0][cantidad]">
<select id="" name="productos[0][tipo]">
<option value="kg">Kg.</option>
<option value="lt">Lt.</option>
<option value="otro">Otro</option>
</select>
</div>
<div class="producto">
<input type="" name="productos[1][nombre]">
<input type="" name="productos[1][cantidad]">
<select id="" name="productos[1][tipo]">
<option value="kg">Kg.</option>
<option value="lt">Lt.</option>
<option value="otro">Otro</option>
</select>
</div>
<input type="submit" value="Enviar">
</form>
</body>
</html>
<table>
<tr>
<th>Producto</th>
<th>Cantidad</th>
<th>Tipo</th>
</tr>
<?php foreach ($_POST['productos'] as $producto): ?>
<tr>
<td><?=$producto['nombre']?></td>
<td><?=$producto['cantidad']?></td>
<td><?=$producto['tipo']?></td>
</tr>
<?php endforeach; ?>
</table>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment