PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
I have a script, based on the button pressed it will forward to a certain page.That bit works fine. What the problem is the variables that are sent are not being passed on to those forwarded pages....
<?PHP
//print_r($_GET);
$ClientDetailID = $_GET['ClientDetailID'];
$HotelRoomID = $_GET['HotelRoomID'];
$AvailableFrom = $_GET['AvailableFrom '];
$AvailableTo = $_GET['AvailableTo'];
$Confirm = $_GET['Confirm'];
$Release = $_GET['Release'];
$ResortID = $_GET['ResortID'];
$status = "OK"; // setting the flag for form validation
$msg=""; // error message string is blank
// Now let us check if name is entered or not
if(strlen($HotelRoomID) < 1 ){ // if name is less than two char length
$msg .="<center>Please select a room</center><BR>";
$status="NOT OK";
}
if($status<>"OK"){ // if form validation is not passed
echo "<BR><BR>";
echo $msg. "<br><center><input type='button' value='Retry' onClick='history.go(-1)'></center><br><br><br>";
}else{
if ($_GET['Confirm'] > "") {
header('Location: conaddops.php?HotelRoomID='.$HotelRoomID.'&AvailableFrom='.$AvailableFrom.'');
} elseif ($_GET['Release'] > "") {
header('Location: releaseaddops.php?HotelRoomID='.$HotelRoomID.'&AvailableFrom='.$AvailableFrom.'');
}else{
header('Location:flightsearch.php?ResortID='.$ResortID.'&AvailableFrom='.$_GET['AvailableFrom '].'&AvailableTo='.$_GET['AvailableTo'].'&ClientDetailID='.$_GET['ClientDetailID'].'');
}
}
?>
Finally though not a problem in this case you should get used to putting either die(); or exit(); after your header locations to stop code below it from executing.