Ver Mensaje Individual
  #4 (permalink)  
Antiguo 07/10/2010, 01:38
Avatar de repara2
repara2
 
Fecha de Ingreso: septiembre-2010
Ubicación: München
Mensajes: 2.445
Antigüedad: 14 años, 5 meses
Puntos: 331
Respuesta: insetar registos

Ejecuta esto en tu server y ajustalo a tu programa:

Código PHP:
<?php 
if(!isset($_POST['Submit'])){
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Documento sin t&iacute;tulo</title>
</head>
<body>
<form id="form1" name="form1" method="post" action="<?=$_SERVER['PHP_SELF']?>">
  <table width="62%" border="0" align="center">
    <tr>
      <td colspan="2"><div align="center">Listado de usuarios para el listado 69 </div></td>
    </tr>
    <tr>
      <td>1. Pedro Gonzalez </td>
      <td><label>
        <input type="checkbox" name="1" value="1_69" />
        </label>
      </td>
    </tr>
    <tr>
      <td>2. Jos&eacute; Garc&iacute;a </td>
      <td><input type="checkbox" name="2" value="2_69" /></td>
    </tr>
    <tr>
      <td colspan="2"><label>
        <div align="center">
          <input type="submit" name="Submit" value="Enviar" />
        </div>
        </label></td>
    </tr>
  </table>
</form>
</body>
</html>
<?php } else {
//Procesar
foreach($_POST as $user => $value){ //Por cada elemento del post
if($user!="Submit"){ //menos si se trata del botón del formulario
$val explode("_"$value);
$usuarios[$val[0]] = $val[1];
}
}
echo 
"Usuarios seleccionados<br/>";
print_r($usuarios);

foreach(
$usuarios as $usuario => $listado){
//Insert into usuarios.... etc
echo "<br>Dando permisos a usuario $usuario en listado $listado<br>";
}

}
?>