Ver Mensaje Individual
  #6 (permalink)  
Antiguo 16/03/2014, 16:34
lolainas
Invitado
 
Mensajes: n/a
Puntos:
Respuesta: Cómo crear input desde PHP

Todos tus campos se llamarán 'campo1' !!!

index.php
Código PHP:
Ver original
  1. <html>
  2.     <head>
  3.         <title>Formulario</title>
  4.     </head>
  5.     <body>
  6.         <h2>Bingo</h2>
  7.         <p>Introduce en los campos valores del 1 al 20</p>
  8.         <form method="post" action="result.php">
  9.             <?php for ($i = 0; $i < 6; $i++) : ?>
  10.                 <input name="campos[<?= $i ?>]" type="number" />
  11.             <?php endfor; ?>
  12.             <button type="submit">Enviar</button>
  13.         </form>
  14.     </body>
  15. </html>

result.php
Código HTML:
Ver original
  1. <?php
  2.  
  3. var_dump($_POST);