Ver Mensaje Individual
  #1 (permalink)  
Antiguo 06/05/2010, 14:07
tazzwt
 
Fecha de Ingreso: marzo-2010
Mensajes: 432
Antigüedad: 15 años
Puntos: 11
Checkbox PHP con MySQL

Checkbox PHP con MySQL

checkbox marcado valor = 1
checkbox desmarcado valor = 0

Como le puedo enviar el valor de cada checkbox a la consulta con solo hacer onclick ?

index.html
Código HTML:
Ver original
  1. <form action="checkbox.php" method="post">
  2.  
  3. <input type="checkbox" name="check 1">opcion 1
  4. <input type="checkbox" name="check 2">opcion 2
  5. <input type="checkbox" name="check 3">opcion 3
  6. <input type="checkbox" name="check 4">opcion 4
  7. <input type="checkbox" name="check 5">opcion 5
  8. <input type="checkbox" name="check 6">opcion 6
  9. <input type="checkbox" name="check 7">opcion 7
  10. <input type="checkbox" name="check 8">opcion 8
  11. <input type="checkbox" name="check 9">opcion 9
  12. <input type="checkbox" name="check 10">opcion 10
  13. <input type="checkbox" name="check 11">opcion 11
  14. <input type="checkbox" name="check 12">opcion 12
  15. <input type="checkbox" name="check 13">opcion 13
  16. <input type="checkbox" name="check 14">opcion 14
  17. <input type="checkbox" name="check 15">opcion 15
  18. <input type="checkbox" name="check 16">opcion 16
  19. <input type="checkbox" name="check 17">opcion 17
  20. <input type="checkbox" name="check 18">opcion 18
  21. <input type="checkbox" name="check 19">opcion 19
  22. <input type="checkbox" name="check 20">opcion 20
  23. <input type="checkbox" name="check 21">opcion 21
  24. <input type="checkbox" name="check 22">opcion 22
  25. <input type="checkbox" name="check 23">opcion 23
  26. <input type="checkbox" name="check 24">opcion 24
  27. <input type="checkbox" name="check 25">opcion 25
  28. <input type="checkbox" name="check 26">opcion 26
  29. <input type="checkbox" name="check 27">opcion 27
  30. <input type="checkbox" name="check 28">opcion 28
  31. <input type="checkbox" name="check 29">opcion 29
  32. <input type="checkbox" name="check 30">opcion 30
  33.  
  34. </form>

checkbox.php
Código PHP:
Ver original
  1. $q = "UPDATE mitabla set estado= $check_estado".