60*10) ){
// session_unset(); // unset $_SESSION variable for the run-time
// session_destroy(); // destroy session data in storage
// header(‘Location:login.php’);
// @alert(‘your session has expired’);
// }else{
// session_regenerate_id(true);
// $_SESSION[‘last_acted_on’] = time();
// }
// if(!$_SESSION[‘role’]){ header(“location:login.php”); die; }
mysql_connect(‘166.62.8.7′,’swimming’,’Amaze123!’);
mysql_select_db(‘swimming’);
if(isset($_POST[‘submit’])){
$First_Name=$_POST[‘First_Name’];
$Last_Name=$_POST[‘Last_Name’];
$Gender=$_POST[‘Gender’];
$address=$_POST[‘address’];
$Email_Id=$_POST[‘Email_Id’];
$Mobile_Number=$_POST[‘Mobile_Number’];
$checkin=$_POST[‘checkin’];
$checkout=$_POST[‘checkout’];
$rooms=$_POST[‘rooms’];
$adults=$_POST[‘adults’];
$children=$_POST[‘children’];
$rooms_type=$_POST[‘rooms_type’];
if ($_POST[‘captcha’] == $_SESSION[‘cap_code’])
{
// Captcha verification is Correct. Do something here!
//$msg=”The Validation code has been matched.“;
$query=”INSERT INTO `booking` (`First_Name`, `Last_Name`, `Gender`, `address`, `Email_Id`, `Mobile_Number`, `checkin`, `checkout`, `rooms`, `adults`, `children`,`rooms_type`) VALUES (‘$First_Name’, ‘$Last_Name’, ‘$Gender’, ‘$address’, ‘$Email_Id’, ‘$Mobile_Number’, ‘$checkin’, ‘$checkout’, ‘$rooms’, ‘$adults’, ‘$children’,’$rooms_type’);”;
$result=mysql_query($query);
if($result)
{
$SA_email=’meghalaya@hotmail.com’;
$First_Name=$_POST[‘First_Name’];
$Last_Name=$_POST[‘Last_Name’];
$Gender=$_POST[‘Gender’];
$address=$_POST[‘address’];
$Email_Id=$_POST[‘Email_Id’];
$Mobile_Number=$_POST[‘Mobile_Number’];
$checkin=$_POST[‘checkin’];
$checkout=$_POST[‘checkout’];
$rooms=$_POST[‘rooms’];
$adults=$_POST[‘adults’];
$children=$_POST[‘children’];
$rooms_type=$_POST[‘rooms_type’];
$to=$SA_email;
$subject=”There is New booking from guest pending for confirmation.”;
$message = ‘
‘;$message=’
There is New booking from guest pending for confirmation.
‘;
$message.=’
Details are appended below.
‘;
$message .= ‘
First Name: | ” . strip_tags($_POST[‘First_Name’]) . “ |
Last Name: | ” . strip_tags($_POST[‘Last_Name’]) . “ |
Gender: | ” . strip_tags($_POST[‘Gender’]) . “ |
Address: | ” . strip_tags($_POST[‘address’]) . “ |
Email Id: | ” . $_POST[‘Email_Id’] . “ |
Mobile_Number: | ” . $_POST[‘Mobile_Number’] . “ |
checkin: | ” . htmlentities($_POST[‘checkin’]) . “ |
checkout: | ” . htmlentities($_POST[‘checkout’]) . “ |
No of Rooms: | ” . htmlentities($_POST[‘rooms’]) . “ |
Room Type: | ” . htmlentities($_POST[‘rooms_type’]) . “ |
Adults: | ” . htmlentities($_POST[‘adults’]) . “ |
Children: | ” . htmlentities($_POST[‘children’]) . “ |
“;
$message .= ““;
$headers = “MIME-Version: 1.0” . “\r\n”;
$headers .= “Content-type:text/html;charset=UTF-8” . “\r\n”;
// More headers
$headers .= ‘From:
$headers .= ‘Cc: suryakiran.g@gmail.com’ . “\r\n”;
$mail=mail($to, $subject, $message,$headers);
if($mail)
{
print ‘‘;
//echo ““;
}
else{
print ‘‘;
}
}
}
else
{
$msg=”The Validation code does not match!“;
}
}
?>
ROOM BOOKING FORM