Ver Mensaje Individual
  #5 (permalink)  
Antiguo 29/12/2009, 10:42
Avatar de TKZeXe
TKZeXe
 
Fecha de Ingreso: diciembre-2009
Ubicación: Flowers
Mensajes: 166
Antigüedad: 14 años, 4 meses
Puntos: 6
Respuesta: Hay alguna forma de hacer el name de un input interactivo

Bueno esto es la base lo puedes adaptar a tu codigo.
algo rapido.

NO PROBADO

saludos

Código PHP:
Ver original
  1. <?php
  2.  
  3. //10 input generas
  4. for($i=1;$i<10;$i++){
  5. echo "<input type='text' name='preg{$i}' value='0' />";
  6. }
  7.  
  8. echo "<input type='hidden' name='num_preguntas' value='$i' />";
  9.  
  10.  
  11. //////////////////y la web que lo recibe seria
  12. $num_preg=$_POST['num_preguntas'];
  13.  
  14. for($i=1;$i<$num_preg;$i++){
  15. echo "PREGUNTA $i LA RESPUESTA FUE : ".$_POST['preg'.$i]." <BR>";
  16. }
  17.  
  18.  
  19. ?>