Hi there pls refer to the following code
CODE
<?php
include "dbFunction.php";
/*Array ( [spapackage] => 1 [name] => [email] => [telephone] => [hiddenField] => member_id,
password [member_id] => [day] => 1 [month] => Jan [year] => 2008 [time] => 1 [Submit] => Submit ) */
$package = $_POST['spapackage'];
$name = $_POST['name'];
$email = $_POST['email'];
$telephone = $_POST['telephone'];
$member = $_POST['member_id'];
$day = $_POST['day'];
$month = $_POST['month'];
$year = $_POST['year'];
$time = $_POST['time'];
$roomId = "";
$location="/paradigm/thankyou.html";
$con = connect();
$rs3 = mysql_query("Select * from room where packageId = '".$package."'");
//echo "Select * from room where packageId = '".$package."'";
while ($row3 = mysql_fetch_array($rs3))
{
$rs1 = mysql_query("Select count(*) as 'count' from reservation where time = '". $time ."' and apptDay = '".$day."' and apptMonth = '".$month."' and apptYear = '".$year."' and reservation.roomId = '". $row3['roomId']."'");
$row1 = mysql_fetch_array($rs1);
if ($row1['count'] == 0)
{
$roomId = $row3['roomId'];
$roomNumber= $row3['roomNumber'];
$roomName= $row3['roomName'];
}
}
if ($roomId != "")
{
mysql_query("Insert into reservation (name, contact, roomId, apptMonth, apptYear, apptDay, membershipId, email, time)
values ('$name', '$telephone', '$roomId', '$month', '$year', '$day', '$member', '$email', '$time')");
//echo "Insert into reservation (name, contact, roomId, apptMonth, apptYear, apptDay, membershipId, email, time) values ('$name', '$telephone', '$roomId', '$month', '$year', '$day', '$member', '$email', '$time')";
//echo "Registration successful. Your room number is ".$roomNumber;
header("Location:confirmation.php?roomName=".$roomName );
}
else
{
//echo "no room";
header("Location:$location");
}
/*
$rs1 = mysql_query("Select COUNT(*) as 'count' from reservation, room where time = '". $time ."' and apptDay = '".$day."' and apptMonth = '".$month."' and apptYear = '".$year."' and room.packageId = '". $package."' and reservation.roomId = room.roomId");
//echo "Select COUNT(*) from reservation, room where time = '". $time ."' and apptDay = '".$day."' and apptMonth = '".$month."' and apptYear = '".$year."' and room.packageId = '". $package."' and reservation.roomId = room.roomId";
$rs2 = mysql_query("Select COUNT(*) as 'count' from room where packageId = '".$package."'");
$row1 = mysql_fetch_array($rs1);
$row2 = mysql_fetch_array($rs2);
if ($row1['count'] == 0)
{
$rs3 = mysql_query("Select * from room where packageId = '".$package."'");
$row3 = mysql_fetch_array($rs3);
$roomid = $row3['roomId'];
//$rs3 = mysql_query("Select * as 'count' from reservation, room where time = '". $time ."' and apptDay = '".$day."' and apptMonth = '".$month."' and apptYear = '".$year."' and room.packageId = '". $package."' and reservation.roomId = room.roomId");
//
}
else if ($row1['count'] == $row2['count'])
{
$roomid = "";
}
else
{
} */
?>
This is my script to process my hotel website spa booking. The code header("Location:confirmation.php?roomName=".$roomName ); is used to retrieve the $roomName variable and for processing in the confirmation.php page. But I am not very sure how to retrieve >1 variables. For example, retrieving both the $roomName and $roomId variables for confirmation.php, anyone how to code the script for this purpose?