Ver Mensaje Individual
  #2 (permalink)  
Antiguo 05/11/2012, 11:11
rolygc
 
Fecha de Ingreso: abril-2009
Ubicación: en un lugar de la mancha
Mensajes: 236
Antigüedad: 15 años
Puntos: 38
Respuesta: pasar array a php error

es mas seguro pasar el formulario a traves de un metodo post o get y depsues recogerlo con ese metodo y no con REQUEST por lo ke:

1- te falta el metodo por el cual kieres pasar el formulario
2- te falta el nombre en el action donde kieres pasar el formulario
3- te falta el boton de enviar en el formulario
4- te falta el valor de cada chekbox.


despues de estos primero 4 detalles seguir chequeando ke error te da tu script

Código PHP:
<form action="TU_PAGINA.PHP" method="post">
        <p>
        <input type="checkbox" name="PREGUNTA9[]" onchange="limitar(this.name,3);" value="a" /> a<br />
        <input type="checkbox" name="PREGUNTA9[]" onchange="limitar(this.name,3);" value="b" /> b<br />
        <input type="checkbox" name="PREGUNTA9[]" onchange="limitar(this.name,3);" value="c" /> c<br />
        <input type="checkbox" name="PREGUNTA9[]" onchange="limitar(this.name,3);" value="d" /> d<br />
        <input type="checkbox" name="PREGUNTA9[]" onchange="limitar(this.name,3);" value="e" /> e<br />
        </p>
         
       
    <input type="submit" value="Enviar"> 
</form>
</body>
</html>
        
<?php
        
if(isset($_POST['PREGUNTA9'])){
            
            
$preg  $_POST['PREGUNTA9'];
            
            
$val = array();
            
            foreach(
$preg as $p)
                       {
                
$val[] = $p;
               }
            
               
print_r($val);
            
        }
        
?>
buena suerte

Última edición por rolygc; 05/11/2012 a las 11:23