Tema: foreach
Ver Mensaje Individual
  #5 (permalink)  
Antiguo 02/03/2004, 10:19
Avatar de claudiovega
claudiovega
 
Fecha de Ingreso: octubre-2003
Ubicación: Puerto Montt
Mensajes: 3.667
Antigüedad: 20 años, 5 meses
Puntos: 11
hice un pequeño ejemplo, aqui el html

<html>
<body>
<form name="cheques" action="verlo.php" method="post">
<table>
<tr>
<td>
<input type="checkbox" name="grupo1_1" value="algo1"><br>
<input type="checkbox" name="grupo1_2" value="algo2"><br>
<input type="checkbox" name="grupo1_3" value="algo3"><br>
</td>
<td>
<input type="checkbox" name="grupo2_1" value="algo4"><br>
<input type="checkbox" name="grupo2_2" value="algo5"><br>
<input type="checkbox" name="grupo2_3" value="algo6"><br>
</td>
</tr>
</table>
<input type="submit" name="grabar" value="Enviar">
</form>
</body>
</html>

aqui el php:

<?php
for ($i=1;$i<=3;$i++)
{
$var1="grupo1_".$i;
$var2="grupo2_".$i;
echo $_POST[$var1]." ".$_POST[$var2]."<br>";
}
?>

funciona bien.
__________________
Dedicado a proyectos web, actualmente desarrollando un sistema de diseño de flyers online muy fácil de usar.