Ver Mensaje Individual
  #1 (permalink)  
Antiguo 23/06/2009, 12:59
wille
 
Fecha de Ingreso: junio-2009
Mensajes: 4
Antigüedad: 14 años, 10 meses
Puntos: 0
Exclamación input insercion multiple en un for

hola buenas tardes o dias
estoy haciendo un codigo que segun el valor tenga en un input me despliga mas input es decir si escribo 5 me desplega 5 input , cada uno de los input que me despliga deven insertar un dato a mi base de datos

espero explicarme pero si no les pongo mi codigo

Código PHP:
<?php 
$txcertificacion 
= isset($_POST["txcertificacion"])? $_POST["txcertificacion"]: ''
   
//$txcertificacion=$_POST['txcertificacion'];
?>
<form id="form1" name="form1" method="post" action="for.php">
      <table width="200" border="0">
  <tr>
              <td width="108"><h3># de Modulos</h3></td>
              <td width="174"><label>
        <input type="text" name="txcertificacion" id="txcertificacion" />
      </label></td>
          <td width="66"><label>
            <input type="submit" name="button" id="button" value="Enviar" onclick="$resultado;" />
      </label></td>
    </tr>
<?php 
     
for($i=0;$i<$txcertificacion;$i++) {
?>
 
    <tr>
      <td colspan="2"><label>Nombre del modulo</label></td>
      
      <td><input name="nombre" type="text" id="nombre" value="" size="60" /></td>
        <td><?php echo"nombre$i"."   <p>&nbsp;</p>" ?></td>

 <td><?php //echo"".$n."   <p>&nbsp;</p>" ?></td>
        
        </tr>
    
 <?php 
    
}
 
?> 

  </table>
  <table width="200" border="0">
      <tr>
        <td width="108"><h3>&nbsp;</h3></td>
        <td width="174"><label></label></td>
        <td width="66"><label>
        <input type="submit" name="button2" id="button2" value="Guardar" onclick="ejemplo v1.php;" />
        </label></td>
      </tr>
      <?php 
     
for($i=0;$i<$txcertificacion;$i++) {
?>
      <?php 
    
}
 
?>
    </table>
 
</form>