Ver Mensaje Individual
  #4 (permalink)  
Antiguo 12/12/2011, 15:08
webankenovi
Invitado
 
Mensajes: n/a
Puntos:
Respuesta: duda de como insertar datos de post en checkbox

Código PHP:
Ver original
  1. <?php
  2. if (isset($_POST['seleccion'])){
  3.  
  4. $nombre = preparar($_POST['nombre']);
  5. $contrasena = preparar($_POST['contrasena']);
  6. $seleccion = $_POST['seleccion'];
  7.  
  8. }else{
  9.  
  10. echo'<form action="script.php" method="post">
  11.  
  12. usuario<input name="nombre" id="nombre" type="text" maxlength="100" size="30" />
  13. contraseña<input name="contrasena" id="contrasena" type="password" maxlength="100" size="30"/>
  14. 1 <input type="checkbox" name="seleccion" value="1">
  15. 2 <input type="checkbox" name="seleccion" value="2">
  16. 3 <input type="checkbox" name="seleccion" value="3">
  17. <input type="submit" name="Submit" value="Enviar">
  18. </form>';
  19.  
  20. }?>