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> </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.