-
Notifications
You must be signed in to change notification settings - Fork 0
/
show.php
170 lines (134 loc) · 2.95 KB
/
show.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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
<html>
<head>
<style>
header {
background-color: #020202;
padding: 20px;
}
.header-container {
display: flex;
justify-content: space-between;
align-items: center;
}
.logo-container img {
height: 100px;
width: 130px;
}
.hotel-name {
text-align: center;
font-size: 36px;
font-weight: bold;
margin: 0;
text-transform: uppercase;
color: gold;
letter-spacing: 2px;
}
nav li {
display: inline-block;
margin: 0 10px;
}
nav li a {
color: white;
font-size: larger;
}
nav li a.active {
background-color: white;
}
nav li a:hover {
background-color: white;
}
.book-now {
background-image: linear-gradient(to bottom right, gold, gold);
color: #020202;
font-size: x-large;
padding: 30px;
margin-left: 20px;
border-radius: 5px;
}
footer {
background-color: #000;
color: #fff;
}
.footer-content {
display: flex;
justify-content: space-between;
padding: 50px;
background-color: #000;
color: #fff;
}
.contact-info, .address, .social-media {
width: 42%;
}
.contact-info h3, .address h3, .social-media h3 {
font-size: 26px;
margin-bottom: 15px;
}
.contact-info p, .address p {
font-size: 20px;
margin: 0;
line-height: 1.5;
}
.social-media ul {
list-style: none;
display: flex;
justify-content: space-between;
}
.social-media a {
color: #fff;
font-size: 18px;
text-decoration: none;
transition: color 0.2s ease-in-out;
}
.social-media a:hover {
color: #ccc;
}
</style>
</head>
<body>
<?php
/*
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
// Get the name and password from the form
$name = $_POST['name'];
$password = $_POST['password'];
// Load the booking details from the file
$filename = 'data.txt';
$file = file_get_contents($filename);
// Search for the name and password in the file
$search_string = "Name: $name\nPassword: $password\n";
$pos = strpos($file, $search_string);
if ($pos !== false) {
// Extract the booking details from the file
$details = substr($file, $pos);
// Output the booking details
echo "<h1>Booking Details</h1>";
echo nl2br($details);
} else {
// Output an error message if the name and password are not correct
echo "<h1>Error</h1>";
echo "Invalid name or password.";
}
}*/
// Check if the form was submitted
if ($_SERVER["REQUEST_METHOD"] == "POST") {
// Get the form data
$name = $_POST["name"];
$password = $_POST["password"];
// Check if the name and password match the saved data
$filename = "booking_data_" . strtolower(str_replace(" ", "_", $name)) . ".txt";
if (file_exists($filename)) {
$handle = fopen($filename, "r");
$saved_data = fread($handle, filesize($filename));
fclose($handle);
if (strpos($saved_data, "Password: $password") !== false) {
// Display the saved data to the user
echo nl2br($saved_data);
exit();
}
}
// If the name and password don't match, display an error message
echo "Name and/or password not found.";
exit();
}
?>
</body>