Ver Mensaje Individual
  #1 (permalink)  
Antiguo 06/03/2010, 19:03
lalo0002
(Desactivado)
 
Fecha de Ingreso: diciembre-2008
Ubicación: Trujillo - Peru
Mensajes: 341
Antigüedad: 15 años, 4 meses
Puntos: 2
Ayuda con checkbox

Código HTML:
 <form action="Prueba.php"  method="post" name="adminForm">
       <table class="adminlist" cellpadding="1">
	<thead>
	 <tr>
	  <th width="2%" class="title">#</th>
          <th class="title">Descripcion</th>
	  <th width="5%" class="title" >x</th>
	  <th width="5%" class="title" nowrap="nowrap">y</th>
          <th width="5%" class="title" nowrap="nowrap">z</th>
          <th width="5%" class="title" nowrap="nowrap">w</th>
	 </tr>
        </thead>
	 <?php include('ProcesosPHP/conexion.php');
	 $resultado = @mysql_query("SELECT o.`PERF_CODI`, o.`PERM_CODI`, o.`OPPE_x`, o.`OPPE_y`, o.`OPPE_z`,
                                    o.`OPPE_w`, d.`DEPE_DESC`
                                    FROM tnca_oppe o
                                    right JOIN tnca_depe d USING(PERM_CODI)
                                    WHERE `PERF_CODI` = 1 ");
         while ($row = mysql_fetch_array($resultado))
          {
          $contador = $contador + 1;
        ?>
        <tbody>
	 <tr class="row0">
	  <td><?php echo $contador; ?></td>
          <td><?php echo $row['DEPE_DESC']; ?></td>
          <td><input type="checkbox" name="opcion[<?php echo $contador; ?>][0]" value="1" /></td>
          <td><input type="checkbox" name="opcion[<?php echo $contador; ?>][1]"  value="1" /></td>
          <td><input type="checkbox" name="opcion[<?php echo $contador; ?>][2]" value="1" /></td>
          <td><input type="checkbox" name="opcion[<?php echo $contador; ?>][3]" value="1"  /></td>
         </tr>
         <?php } ?>
	</tbody>
       </table>
            <input type="submit" name="Submit">

        </form> 

esto me bota una matriz de checkbox, pero como hago para capturar cada fila de checkbox los que estubieron marcados, -> 1 1 1 0 x ejemplo, y esos numeros ingresarlos en la bd

nombre - checkbox1 - checkbox 2, checkbox 3, checkbox 4 [cabecera]
Gestor de xxx <> <> <> <> [cuerpo fila 1]
Gestor de xxx <> <> <> <> [cuerpo fila 2]
Gestor de xxx <> <> <> <> [cuerpo fila 3]
Gestor de xxx <> <> <> <> [cuerpo fila 4]
Gestor de xxx <> <> <> <> [cuerpo fila 5]

donde <> es un checkbox

como podria hacerlo ?