contact.php
5.91 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
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
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Contact</title>
<link rel="stylesheet" type="text/css" href="css2.css">
<style>
#contact input[type="text"],
#contact input[type="email"],
#contact textarea,
#contact button[type="submit"] {
font: 400 12px/16px "Roboto", Helvetica, Arial, sans-serif;
}
#contact {
background: #F9F9F9;
padding: 25px;
margin: 15px 0;
box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.2), 0 5px 5px 0 rgba(0, 0, 0, 0.24);
}
#contact h3 {
display: block;
font-size: 30px;
font-weight: 300;
margin-bottom: 10px;
}
#contact h4 {
margin: 5px 0 15px;
display: block;
font-size: 13px;
font-weight: 400;
}
fieldset {
border: medium none !important;
margin: 0 0 10px;
min-width: 100%;
padding: 0;
width: 100%;
}
#contact input[type="text"],
#contact input[type="email"],
#contact textarea {
width: 100%;
border: 1px solid #ccc;
background: #FFF;
margin: 0 0 5px;
padding: 10px;
}
#contact input[type="text"]:hover,
#contact input[type="email"]:hover,
#contact textarea:hover {
-webkit-transition: border-color 0.3s ease-in-out;
-moz-transition: border-color 0.3s ease-in-out;
transition: border-color 0.3s ease-in-out;
border: 1px solid #aaa;
}
#contact textarea {
height: 100px;
max-width: 100%;
resize: none;
}
#contact button[type="submit"] {
cursor: pointer;
width: 100%;
border: none;
background: #4CAF50;
color: #FFF;
margin: 0 0 5px;
padding: 10px;
font-size: 20px;
}
#contact button[type="submit"]:hover {
background: #43A047;
-webkit-transition: background 0.3s ease-in-out;
-moz-transition: background 0.3s ease-in-out;
transition: background-color 0.3s ease-in-out;
}
#contact button[type="submit"]:active {
box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.5);
}
#contact input:focus,
#contact textarea:focus {
outline: 0;
border: 1px solid #aaa;
}
</style>
</head>
<body>
<!-- <script id="__bs_script__">//<![CDATA[
document.write("<script async src='/browser-sync/browser-sync-client.js?v=2.26.7'><\/script>".replace("HOST", location.hostname));
</script> -->
<ul>
<li><a href="index.php">Home</a></li>
<li><a href="booking_page.php">Booking</a></li>
<li><a class="active" href="contact.php">Contact</a></li>
<li><a href="user_login.php">Login</a></li>
<li><a href="loginform_for_admin_2.php">Admin login</a></li>
<li><a href="countrypage.html">Countries</a></li>
</ul>
<?php
$Contact_Name = $Email = $Subject = $Message = "";
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$Contact_Name = test_input($_POST["Contact_Name"]);
$Email = test_input($_POST["Email"]);
$Subject = test_input($_POST["Subject"]);
$Message = test_input($_POST["Message"]);
}
function test_input($data) {
$data = trim($data);
$data = stripslashes($data);
$data = htmlspecialchars($data);
return $data;
}
?>
<div class="row">
<div class="container">
<fieldset>
<form id="contact" action="" method="post">
<h3>Contact</h3>
<fieldset>
<label for="Contact_Name">Please enter your name: </label>
<input placeholder="Your name" type="text" name="Contact_Name" tabindex="1" required autofocus>
</fieldset>
<fieldset>
<label for="Email">Please enter your email address: </label>
<input placeholder="Your Email Address" type="email" name="Email" tabindex="2" required>
</fieldset>
<fieldset>
<legend>Please select your subject:</legend>
<select name="Subject">
<option value="Reporting problems in the website">Reporting problems in the website</option>
<option value="Questions, queries and problems using the website">Questions, queries and problems using the website</option>
<option value="Request">Request in the website</option>
<option value="Cancelling a flight">Cancelling a flight</option>
</select>
</fieldset>
<fieldset>
<legend>Please type in your message:</legend>
<textarea placeholder="Type your message here...." name="Message" tabindex="5" required></textarea>
</fieldset>
<fieldset>
<button name="submit" type="submit" id="contact-submit" class="button7" data-submit="...Sending">Submit</button>
</fieldset>
</form>
</fieldset>
</div>
<?php
if(isset($_POST['submit'])){
$selected_val = $_POST['Subject']; // Storing Selected Value In Variable
echo "You have selected :" .$selected_val; // Displaying Selected Value
}
?>
<?php
// connect to the database
$con = mysqli_connect(localhost,root, root, Airline_Booking, 8889);
// Check connection
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
$data = mysqli_query($con, "INSERT INTO Contact (Contact_Name, Email, Subject, Message)
VALUES ('$Contact_Name', '$Email', '$Subject', '$Message')");
mysqli_close($con);
echo "Your input:::::::::<br>";
echo "".$Contact_Name. "<br>";
echo "".$Email. "<br>";
echo "".$Subject. "<br>";
echo "".$Message. "<br>";
?>
</div>
<!-- social media block -->
<div class="social twitter">
<a href="#" target="_blank"><i class="fa fa-twitter fa-2x"></i></a>
</div>
<div class="social instagram">
<a href="#" target="_blank"><i class="fa fa-instagram fa-2x"></i></a>
</div>
<div class="social facebook">
<a href="#" target="_blank"><i class="fa fa-facebook fa-2x"></i></a>
</div>
</body>
</html>