-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcontacts.php
More file actions
156 lines (136 loc) · 4.33 KB
/
contacts.php
File metadata and controls
156 lines (136 loc) · 4.33 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
<?php
session_start();
// Database connection
$connection = new mysqli("localhost", "root", "", "tourism");
if ($connection->connect_error) {
die("Connection failed: " . $connection->connect_error);
}
$success = "";
$error = "";
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$name = trim($_POST["name"]);
$email = trim($_POST["email"]);
$subject = trim($_POST["subject"]);
$message = trim($_POST["message"]);
if (!empty($name) && !empty($email) && !empty($subject) && !empty($message)) {
$stmt = $connection->prepare("INSERT INTO contact_messages (name, email, subject, message) VALUES (?, ?, ?, ?)");
$stmt->bind_param("ssss", $name, $email, $subject, $message);
if ($stmt->execute()) {
$success = "Message sent successfully!";
} else {
$error = "Something went wrong. Try again.";
}
$stmt->close();
} else {
$error = "All fields are required.";
}
}
$connection->close();
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Contact Us - Tourism Information System</title>
<style>
body {
font-family: 'Segoe UI', sans-serif;
background: #e6f2ff;
padding: 20px;
}
.contact-header {
text-align: center;
margin-bottom: 30px;
}
.contact-header h1 {
color: #004080;
}
.contact-header p {
color: #333;
}
.contact-container {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
max-width: 1000px;
margin: auto;
background: white;
padding: 20px;
border-radius: 10px;
box-shadow: 0 0 10px #aaa;
}
.contact-info, .contact-form {
flex: 1;
min-width: 300px;
margin: 10px;
}
.contact-info h2, .contact-form h2 {
color: #004080;
}
.contact-info p {
margin: 8px 0;
color: #555;
}
input, textarea {
width: 100%;
padding: 10px;
margin: 8px 0;
border: 1px solid #ccc;
border-radius: 5px;
}
button {
padding: 10px;
width: 100%;
background: #0073e6;
color: white;
border: none;
cursor: pointer;
border-radius: 5px;
}
button:hover {
background: #005bb5;
}
.success { color: green; }
.error { color: red; }
a {
text-decoration: none;
color: #004080;
display: block;
text-align: center;
margin-top: 20px;
}
</style>
</head>
<body>
<div class="contact-header">
<h1>Contact Tourism Support</h1>
<p>Planning a trip or need help? Reach out to our tourism help desk for guidance and support.</p>
</div>
<div class="contact-container">
<div class="contact-info">
<h2>Tourism Office Information</h2>
<p><i class="fas fa-map-marker-alt"></i> Tourism Board, Chitwan , Nepal</p>
<p><i class="fas fa-phone"></i> +977-9847494444</p>
<p><i class="fas fa-envelope"></i> info@tourismnepal.gov.np</p>
<p><i class="fas fa-globe"></i> www.tourismnepal.gov.np</p>
</div>
<div class="contact-form">
<h2>Send Us a Message</h2>
<?php if ($success) echo "<p class='success'>$success</p>"; ?>
<?php if ($error) echo "<p class='error'>$error</p>"; ?>
<form method="POST" action="">
<label for="name">Full Name</label>
<input type="text" id="name" name="name" placeholder="Enter your name" required>
<label for="email">Email Address</label>
<input type="email" id="email" name="email" placeholder="Enter your email" required>
<label for="subject">Subject</label>
<input type="text" id="subject" name="subject" placeholder="Enter subject" required>
<label for="message">Message</label>
<textarea id="message" name="message" rows="5" placeholder="Enter your message" required></textarea>
<button type="submit">Send Message</button>
</form>
</div>
</div>
<a href="index.php">⬅ Back to Home</a>
</body>
</html>