Amigos: tengo un formulario con algunos radiobuttons...y no logro que funcionen!
Despues de dar a enviar... se marca solo siempre el mismo Radio y me informa que fue clickeado siempre el mismo (el [0])
Código CODE:
Ver original<html>
<head>
<title>Array en Forma :: PHP</title>
<head>
<body>
<br />
<b>Selecciona tus postres favoritos:</b><br /><br />
<form method="post" action="<?= $_SERVER['PHP_SELF'] ?>">
<input name="postre[]" type="checkbox"
value="Helado de Vainilla">Helado de vanilla<br />
<input name="postre[]" type="checkbox"
value="Pastel de Chocolate">Pastel de Chocolate<br />
<input name="postre[]" type="checkbox"
value="Pay de elote">Pay de elote<br />
<input name="postre[]" type="checkbox"
value="Bubulubu">Bubulubu<br />
<input name="postre[]" type="checkbox"
value="Duraznos en almibar">Duraznos en almibar<br />
<input name="postre[]" type="checkbox"
value="Fresas con crema">Fresas con crema<br />
<p/>
<input type='radio' name='formato[]' id='solo' />Solo<br>
<input type='radio' name='formato[]' checked='checked' id='postre' />De postre<br>
<input name="send" type="submit" id="send" value="Enviar!">
</form>
<?php
if (isset($_POST['postre']))
{
$postre = $_POST['postre'];
$n = count($postre);
$i = 0;
echo "Tus postres favoritos son: rn" .
"<ol>";
while ($i < $n)
{
echo "<li>{$postre[$i]}</li> rn";
$i++;
}
echo "</ol>";
}
$formato = $_POST['formato'];
var_dump ($formato);
?>
</body>
</html>
A ver si me pueden ayudar! gracias!