Ver Mensaje Individual
  #7 (permalink)  
Antiguo 23/03/2007, 20:51
taar
 
Fecha de Ingreso: diciembre-2001
Ubicación: Asuncion
Mensajes: 143
Antigüedad: 22 años, 4 meses
Puntos: 1
Re: Nombre de variable al checkbox???

cala932, si no sabes cuantos $box vas a tener es mejor que utilices array. Seria algo asi:
Código PHP:
<body>
<?
if ( $_POST )
{
    foreach( 
$_POST['boxes'] as $k => $v )
    {
        print 
"box $k - value:$v <br />";
    }    
}
?>

<form action="pagina1.php" method="post">
<?
$i
=0;
while(
$i )
{
    
?>
    <input type="checkbox" name="boxes[]" value="<?=$i?>" />
    <br />
    <?
    $i
++;
}
?>
<input type="submit" value="Enviar" />
</form>
</body>