Tema: chek no anda
Ver Mensaje Individual
  #7 (permalink)  
Antiguo 08/02/2011, 13:17
Avatar de jonasanx
jonasanx
 
Fecha de Ingreso: enero-2011
Ubicación: La Via Lactea, Mexico, Mexico, Mexico
Mensajes: 134
Antigüedad: 13 años, 3 meses
Puntos: 4
Respuesta: chek no anda

Cita:
Iniciado por Nano_ Ver Mensaje
Saludos

Revisa los comentarios que te indico en el código!
Código PHP:
<?php
while ($registro mysql_fetch_array($resultado)) {

    echo 
"<tr>";

    echo 
"<td>";

    echo 
$registro['titulos'];
    echo 
"</td>";
    echo 
"<td>";
    echo 
$registro['parrafos'];
    echo 
"<td width='50'><input type='radio' value='onn'  name=" $registro['id'] . ">on</td><td width='50'><input type='radio' value='off' name=" $registro['id'] . ">off</td>";
    
//Maneja comillas sencillas en los name
    //Donde esta el form?? Esto es todo el fomulario?
    
}
$registro mysql_fetch_array($resultado);//Por que repites esta parte del codigo
$rows mysql_num_rows($resultado);
echo 
"<br/><input type='submit' name='ace' value='Aceptar'>";
?>


</td></tr></table> 
<?php
if (isset($_POST['ace'])) {
    
mifuncion();
}

function 
mifuncion() {
    echo 
"si se presiono";
    
//$rows que es???
    
for ($i 0$i $rows$i++) {
        if (isset(
$_POST[$i])) {//Esto esta mal
            
echo "Se ha presionado el boton radio.$i.<br/>";

            echo 
"tambien se preciono el radio con name 1";
            echo 
$i;
        }
    }
}
hahaha, si fuera su maestro, le diría: ¡vuelvelo a hacer!