1) On the index.html (first file) I catch some vars valuesusing a calendar, and the I pass then to "book001.php" this way:
book001.php?checkin=2/8/2008&checkout=2/10/2008&adults=2&rooms=1
2) my code on "book001.php" is like this:
<?php
session_start();
?>
Availability for days: <?php echo '<b>' . $GET["checkin"] . '</b>'; ?> to
<?php echo '<b>' . $GET["checkout"] . '</b>'; ?>
<?php
if (count($_SESSION)>0){
echo "<span class='55'>" . 'Check in:' . $_GET["checkin"] . ' ' . 'Check out:' . $_GET["checkout"] . ' ' . 'Rooms:' . $_GET["rooms"] . ' ' . 'Adults:' . $_GET["adults"] . "</span>";
$_SESSION["checkinnew"]=$_GET["checkin"];
$_SESSION["checkoutnew"]=$_GET["checkout"];
if($_POST[room5_qty]>0 || $_POST[room4_qty]>0 || $_POST[room3_qty]>0 || $_POST[room2_qty]>0 || $_POST[room1_qty]>0)
{
$_SESSION["room5_id"]=$_POST["room5_qty"];
$_SESSION["room4_id"]=$_POST["room4_qty"];
$_SESSION["room3_id"]=$_POST["room3_qty"];
$_SESSION["room2_id"]=$_POST["room2_qty"];
$_SESSION["room1_id"]=$_POST["room1_qty"];
echo '<script type="text/javascript">
window.location = "book002.php";
</script>';
}
?>
3) my next file (book002.php) is like this:
The data we should have loaded is:
<?php echo $SESSION["checkinnew"]; ?> // does not print
<?php echo $SESSION["checkoutnew"];?> // does not print
<?php echo $SESSION["room5_id"]; ?> // PRINTS OK
<?php echo $SESSION["room4_id"];?> // PRINTS OK
// ..................
// OK , I hope we can fix it together. You know ? I have been looking for it iin some books and I found that sometimes there could be a problem with $SESSION and $GET or $POST, because they (get and post) can not give their values to $session in some cases.. the weird thing is that in this case all the vars used with $POST DO work, they give their values to $SESSION, but those that come with $_GET... do not... 🙁
Please... urgent help !
Thanks in advance,
Jiten