Ver Mensaje Individual
  #9 (permalink)  
Antiguo 23/01/2007, 12:57
Nexus_
 
Fecha de Ingreso: noviembre-2006
Mensajes: 146
Antigüedad: 18 años, 3 meses
Puntos: 1
Re: Lista de checkboxes en tiempo de ejecucion

Prueba a ver

Código PHP:
<?php
if (!$_POST) {
?>
<html>
<head>
<title>Untitled Document</title>
</head>

<body>
<center>
<h1>Administracion de Comentarios</h1>
<form action="administracion.php" method="post" name="administracion">
<?php
mysql_select_db
($database_cn$cn);
$resultmysql_query("SELECT Idcoment, nomc, corc, telc, come, flag FROM comentarios",$cn);
if (
$rowmysql_fetch_array($result)){
    echo 
"<table border = '1'>\n";
    echo 
"<tr><td>Numero</td><td>Nombre</td><td>E-mail</td><td>Telefono</td><td>Comentario</td><td>Atendido</td><td>Marcar</td></tr> \n";
    do {
        echo 
"<tr><td>".
        
$row["Idcoment"].
        
"</td><td>".
        
$row["nomc"].
        
"</td><td>".
        
$row["corc"].
        
"</td><td>".
        
$row["telc"].
        
"</td><td>".
        
$row["come"].
        
"</td><td>".
        
$row["flag"].
        
"</td><td>";
            if (
$row["flag"]==0) {
                echo 
"<input type='hidden' name='valor[]'>
                <input type='checkbox' name='nombre[]'>"
;
            }
            else {
                echo 
"Listo";
            }
    }
    while (
$row=mysql_fetch_array($result));
    echo 
"</td></tr></table>";
    echo 
"<table border = '1'>\n <br><br>";
    echo 
"<tr><td align='center'>
    <input type='submit' name='actualizar' value='Actualizar'></td><td align='center'>
    <input type='submit' name='eliminar' value='Eliminar'></td><td align='center'>
    <input type='reset' name='limpiar' value='Limpiar'></td></tr></table>"
;
    echo 
"\t</tr>\n";
    echo 
"</table> \n";
}
else
echo 
"¡No se ha encontrado ningun registro!";
?>
</form>
<?php
}
?>
</center>
</body>

</html>
Responder Con Cita
Suerte :)