![Antiguo](http://static.forosdelweb.com/fdwtheme/images/statusicon/post_old.gif)
30/11/2013, 19:37
|
![Avatar de xSkArx](http://static.forosdelweb.com/customavatars/avatar376106_1.gif) | | | Fecha de Ingreso: marzo-2008 Ubicación: Chile
Mensajes: 945
Antigüedad: 16 años, 11 meses Puntos: 96 | |
Respuesta: Almacenar variables en array desde formulario Prueba esto
Código PHP:
Ver original<?php ?> <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title></title> </head> <body> <center> <?php if(isset($_POST['producto']) && isset($_POST['referencia'])) { $_SESSION['array'][]['producto']=$_POST['producto']; $_SESSION['array'][]['referencia']=$_POST['referencia]; } foreach($_SESSION['array'] as $array) { foreach($array as $clave=>$valor){ echo $clave . " " . $valor['producto']; } } ?> <form name="formulario" action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post"> Producto:<input type="text" name="producto"/> Referencia:<input type="text" name="referencia"/><br/> <input type="submit" value="Insertar"/> </form> </center> </body> </html>
__________________ Busca, lee y practica todo lo que puedas.
Usa siempre el buscador antes de postear.
Si posteas código, utiliza el HIGHLIGHT correcto. |