Ver Mensaje Individual
  #5 (permalink)  
Antiguo 06/01/2011, 09:41
Avatar de arielcasanova
arielcasanova
 
Fecha de Ingreso: octubre-2004
Ubicación: Bahía Blanca - Argentina
Mensajes: 332
Antigüedad: 19 años, 6 meses
Puntos: 1
Respuesta: problema con sesiones

Mirá, tengo este formulario:

Código:
<form action="reserva.php" name="formulario" method="post" enctype="multipart/form-data">
<input type="hidden" name="id_unidad" value="<?php echo $id_unidad; ?>" />
<input type="hidden" name="id_propiedad" value="<?php echo $id_propiedad; ?>" />
<table width="511" border="1">
  <tr>
    <td width="226">Fecha desde</td>
    <td width="458"><input name="fecha_desde" id="fecha_desde" type="text" class="inputi"  value="<?php if ($fecha_desde=="") {echo $hoy;} else {echo $fecha_desde; }?>" /></td>
  </tr>
  <tr>
    <td>Fecha hasta</td>
    <td><input name="fecha_hasta" id="fecha_hasta" type="text" class="inputi" value="<?php if ($fecha_hasta=="") {?>AAAA-MM-DD<?php } else {echo $fecha_hasta; }?>" /></td>
  </tr>
  <tr>
    <td><input type="submit" name="Submit2" id="Submit" value="Reservar" /></td>
    <td>&nbsp;</td>
  </tr>
</table>
</form>
Y cuando hago echo del dump me dice:

array(5) { ["sesion"]=> &string(2) "SI" ["id_unidad"]=> &string(2) "10" ["id_cliente"]=> &string(2) "20" ["fecha_desde"]=> &NULL ["fecha_hasta"]=> &NULL }


previamente, me loguee pasando por un archivo, control.php, que tiene el siguiente código

Código:
$sql="SELECT * from pactemos_clientes
where user='$usuario' and pass='$contrasena'";

$result = mysql_query($sql, $conexion);

while ($row=mysql_fetch_array($result))
{
$id_cliente=$row['id'];
}	  

	
if ($id_cliente!="")
	{
	session_start();
	$_SESSION["sesion"]= "SI";
	$_SESSION["id_unidad"]= $id_unidad;	
	$_SESSION["id_cliente"]= $id_cliente;	
	$_SESSION["fecha_desde"]= $fecha_desde;	
	$_SESSION["fecha_hasta"]= $fecha_hasta;		
	
	header ("Location: $pagina.php");	
	}
	else 
	{ 
	$_SESSION["id_unidad"]= $id_unidad;	
	$_SESSION["fecha_desde"]= $fecha_desde;	
	$_SESSION["fecha_hasta"]= $fecha_hasta;		
	
	header ("Location: $pagina.php?errorusuario=si");	
		//si no existe le mando otra vez a la portada 
	} 
?>
¿Esto te da alguna pista más? Yo estoy perdidísimo.
__________________
Ariel Casanova
diseño y desarrollo web estratégico
www.emporia.com.ar