![Antiguo](http://static.forosdelweb.com/fdwtheme/images/statusicon/post_old.gif)
12/11/2008, 13:26
|
![Avatar de hoberwilly](http://static.forosdelweb.com/customavatars/avatar246730_1.gif) | | | Fecha de Ingreso: julio-2008 Ubicación: Lima - Perú
Mensajes: 769
Antigüedad: 16 años, 7 meses Puntos: 2 | |
Respuesta: Insertar caja de texto a sesion Bien alguien si me podria ayudar, he modificado los codigos anteriormente descritos y obtuve esto:
listado.php
----------------
<form action="agregacarrito2.php" method="post">
foreach($carro as $k => $v){
<?php echo $v['id'] ?><?php echo $v['medicamento'] ?>
<input type="text" name="cantidad_autorizada[]" id="cantidad_autorizada"> //AQUI EL NAME ESTA CORRECTO
<?php } ?>
<input type="submit" value="autorizar pedido"> //boton submit
</form>
agregacarrito2.php
--------------------------
<?php
session_start();
$autori=$_POST["cantidad_autorizada"]; //RECOJO ARRAY DE LISTADO PHP A AUTORI
if(isset($_SESSION['carro'])) //SI EXISTE LA SESION
$carro=$_SESSION['carro']; //ASIGNO A LA VARIABLE CARRO
array_push($carro,$autori); //AÑADO EL ARRAY AUTORI AL ARRAY CARRO
$_SESSION['carro']=$carro; //LE ASIGNO A LA SESION
header("Location:listadoNoatendido.php?".SID);
?>
listado2.php
------------------
foreach($carro as $k => $v){ //RECORRER EL NUEVO ARRAY
<?php echo $v['cantidad_autorizada'] ?> //NO ME VISUALIZA NADA???????? |