Ver Mensaje Individual
  #10 (permalink)  
Antiguo 14/03/2010, 13:50
Avatar de santris
santris
 
Fecha de Ingreso: agosto-2009
Ubicación: Sant Feliu de Llobregat
Mensajes: 955
Antigüedad: 14 años, 9 meses
Puntos: 66
Respuesta: pasar valor metido en campo a una variable

Código PHP:
<form action"donde esté el script que genera el 2 form">
< input type="text" name="cantidad" />
<input type="submit">
</form>

<?php
if(isset($_POST["cantidad"])){
?>
<form>
<?php
$num
=$_POST["cantidad"];

for (
$i 1$i <= $num$i++) {
echo 
"<input type=text name=ingrediente".$i."/><br/>";
}
?>
<input type="submit">
</form>
<?php
}
?>
__________________
Tu álbum de cromos online!!