-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsubmit_booking.php
More file actions
26 lines (25 loc) · 1.14 KB
/
submit_booking.php
File metadata and controls
26 lines (25 loc) · 1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<?php
$name = $_POST['name'];
$contact = $_POST['contact'];
$event_date = $_POST['event_date'];
$location = $_POST['location'];
$bouncer_qty = $_POST['bouncer_qty'];
$watchman_qty = $_POST['watchman_qty'];
$vip_qty = $_POST['vip_qty'];
$id_checker_qty = $_POST['id_checker_qty'];
$total_amount = $_POST['total_amount'];
// database connection
$conn = new mysqli('sql302.infinityfree.com', 'if0_39811684', 'MyUU2VvqUP', 'if0_39811684_guardzone');
if ($conn->connect_error) {
die('Connection failed: ' . $conn->connect_error);
} else {
$stmt = $conn->prepare("INSERT INTO demo_booking (name, contact, event_date, location, bouncer_qty, watchman_qty, vip_qty,id_checker_qty) VALUES(?, ?, ?, ?, ?, ?, ?,?)");
$stmt->bind_param("sissiiii", $name, $contact, $event_date, $location, $bouncer_qty, $watchman_qty, $vip_qty, $id_checker_qty);
$stmt->execute();
echo "Registration successful!";
echo "<p>Thank you, <strong>$name</strong>. Your event has been booked for <strong>$event_date</strong> at <strong>$location</strong>.</p>";
echo "<a href='index.html'>Go Back Home</a>";
$stmt->close();
$conn->close();
}
?>