Tengo un problema con un arreglo de sesion.
Al momento de capturar los datos del formulario si me guarda los datos en la session, pero al momento de quererlos mostrar en el mismo formulario pero con la condición de que ya existe la session solo me muestra el primer dato pero los demás no. Ademas ya me fije en el codigo fuente y el valor de los input si contiene el valor de la session.
este es mi formulario:
Código PHP:
Ver original
<form action="procesos_pedido.php?accion=2" method="POST" name="captura_cliente" id="captura_cliente"> <fieldset> <legend>Datos del cliente</legend> <div class="izquierda"> <label for="razon_social">Razon social</label> <input type="text" name="razon_social" id="razon_social" size="60" /><br /> <input type="hidden" name="clienteID" id="clienteID" /> <label for="domicilio">Domicilio</label> <input type="text" name="domicilio" id="domicilio" size="60" readonly="readonly" /><br /> <label for="estado_pais">Estado / país</label> <input type="text" name="estado_pais" id="estado_pais" size="30" readonly="readonly" /><br /> <label for="rfc">RFC</label> <input type="text" name="rfc" id="rfc" size="30" readonly="readonly" /><br /> <label for="tel">Telefono</label> <input type="text" name="tel" id="tel" size="30" readonly="readonly" /> </div> <div class="derecha"> <label for="hotel">Nombre Hotel</label> <input type="text" name="hotel" id="hotel" size="50" /><br /> <label for="colonia">Colonia</label> <input type="text" name="colonia" id="colonia" size="50" readonly="readonly" /><br /> <label for="poblacion">Población</label> <input type="text" name="poblacion" id="poblacion" size="30" readonly="readonly" /><br /> <label for="cp">Codigo postal</label> <input type="text" name="cp" id="cp" size="30" readonly="readonly" /> </div> </fieldset> <br /> <fieldset> <legend>Referencias</legend> <div class="izquierda"> <label for="numero_cuenta">No. cuenta</label> <input type="text" name="numero_cuenta" id="numero_cuenta" size="30" readonly="readonly" /><br /> <label for="asociado">Asociado</label> <input type="text" name="asociado" id="asociado" size="50" readonly="readonly" /><br /> </div> <div class="derecha"> <label for="forma_pago">Forma pago</label> <input type="text" name="forma_pago" id="forma_pago" size="30" readonly="readonly" /><br /> <label for="estado">Estado</label> <input type="text" name="estado" id="estado" size="30" readonly="readonly" /><br /> </div> </fieldset> <a class="boton-izq regresar-izq flotar-izq" onclick="javascript:document.location.href= 'nuevo_pedido.php'" >Regresar</a> <input type="submit" class="boton-der confirmar-der flotar-der" name="confirmar" id="confirmar" value="Confirmar" /> <?php else: $sCliente = $_SESSION['cliente']; ?> <fieldset> <legend>Datos del cliente</legend> <div class="izquierda"> <label for="razon_social">Razon social</label> <input type="text" name="razon_social" id="razon_social" size="60" value="<?php echo $sCliente['razon_social']; ?>" /><br /> <input type="hidden" name="clienteID" id="clienteID" value="<?php echo $sCliente['clienteID']; ?>" /> <label for="domicilio">Domicilio</label> <input type="text" name="domicilio" id="domicilio" size="60" value="<?php echo $sCliente['domicilio']; ?>" readonly="readonly" /><br /> <label for="estado_pais">Estado / país</label> <input type="text" name="estado_pais" id="estado_pais" size="30" readonly="readonly" /><br /> <label for="rfc">RFC</label> <input type="text" name="rfc" id="rfc" size="30" readonly="readonly" /><br /> <label for="tel">Telefono</label> <input type="text" name="tel" id="tel" size="30" readonly="readonly" /> </div> <div class="derecha"> <label for="hotel">Nombre Hotel</label> <input type="text" name="hotel" id="hotel" size="50" /><br /> <label for="colonia">Colonia</label> <input type="text" name="colonia" id="colonia" size="50" readonly="readonly" /><br /> <label for="poblacion">Población</label> <input type="text" name="poblacion" id="poblacion" size="30" readonly="readonly" /><br /> <label for="cp">Codigo postal</label> <input type="text" name="cp" id="cp" size="30" readonly="readonly" /> </div> </fieldset> <br /> <fieldset> <legend>Referencias</legend> <div class="izquierda"> <label for="numero_cuenta">No. cuenta</label> <input type="text" name="numero_cuenta" id="numero_cuenta" size="30" readonly="readonly" /><br /> <label for="asociado">Asociado</label> <input type="text" name="asociado" id="asociado" size="50" readonly="readonly" /><br /> </div> <div class="derecha"> <label for="forma_pago">Forma pago</label> <input type="text" name="forma_pago" id="forma_pago" size="30" readonly="readonly" /><br /> <label for="estado">Estado</label> <input type="text" name="estado" id="estado" size="30" readonly="readonly" /><br /> </div> </fieldset> <a class="boton-izq regresar-izq flotar-izq" onclick="javascript:document.location.href= 'nuevo_pedido.php'" >Regresar</a> <!-- <input type="submit" class="boton-der confirmar-der flotar-der" name="confirmarNuevo" id="confirmarNuevo" value="Confirmar" /> --> <?php endif; ?> </form>
este es el archivo que me crea la sesion:
Código PHP:
Ver original
@$cliente = $_SESSION['cliente']; "clienteID"=>$_POST['clienteID'], "razon_social"=>$_POST['razon_social'], "domicilio"=>$_POST['domicilio'], "estado_pais"=>$_POST['estado_pais'], "rfc"=>$_POST['rfc'], "tel"=>$_POST['tel'], "colonia"=>$_POST['colonia'], "poblacion"=>$_POST['poblacion'], "cp"=>$_POST['cp'], "numero_cuenta"=>$_POST['numero_cuenta'], "asociado"=>$_POST['asociado'], "forma_pago"=>$_POST['forma_pago'], "estado"=>$_POST['estado'] ); $_SESSION['cliente'] = $cliente;
Alguien me podría apoyar con esto. Se los agradecería mucho.