-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtourssafe.php
134 lines (84 loc) · 2.83 KB
/
tourssafe.php
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>SkyFly - Explore the World</title>
<!--
- favicon
-->
<link rel="shortcut icon" href="./favicon.svg" type="image/svg+xml">
<!--
- custom css link
-->
<link rel="stylesheet" href="./assets/css/style.css">
<!--
- google font link
-->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link
href="https://fonts.googleapis.com/css2?family=Abril+Fatface&family=Comforter+Brush&family=Heebo:wght@400;500;600;700&display=swap"
rel="stylesheet">
</head>
<body id="top">
<!--
- #HEADER
-->
<header class="header" data-header>
<div class="container">
<a href="#">
<h1 class="logo">SkyFly</h1>
</a>
<button class="nav-toggle-btn" data-nav-toggle-btn aria-label="Toggle Menu">
<ion-icon name="menu-outline" class="open"></ion-icon>
<ion-icon name="close-outline" class="close"></ion-icon>
</button>
<nav class="navbar">
<ul class="navbar-list">
<li>
<a href="#" class="navbar-link">Destinations</a>
</li>
<li>
<a href="/tours.html" class="navbar-link">Tours</a>
</li>
<li>
<a href="/hotels.html" class="navbar-link">Hotels</a>
</li>
<li>
<a href="/aboutus.html" class="navbar-link">About Us</a>
</li>
</ul>
<a href="#" class="btn btn-secondary">Booking Now</a>
</nav>
</div>
</header>
<form method="post" action="booktour.php">
<label for="place">Place:</label>
<select id="place" name="place" required>
<option value="">Select a place</option>
<?php
// Include the database configuration file
include 'config.php';
// Create a connection to the database
$conn = mysqli_connect($dbhost, $dbuser, $dbpass, $dbname);
// Check if the connection is successful
if (!$conn) {
die("Connection failed: " . mysqli_connect_error());
}
// Retrieve the list of places from the newtours table
$sql = "SELECT DISTINCT place FROM tours ORDER BY place ASC";
$result = mysqli_query($conn, $sql);
// Loop through the results and create a dropdown option for each place
while ($row = mysqli_fetch_assoc($result)) {
echo "<option value=\"" . $row['place'] . "\">" . $row['place'] . "</option>";
}
// Close the database connection
mysqli_close($conn);
?>
</select>
<label for="tour_date">Tour Date:</label>
<input type="date" id="tour_date" name="tour_date" required>
<input type="submit" value="Search">
</form>