-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathcontact.php
80 lines (70 loc) · 2.79 KB
/
contact.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
<?php
session_start();
// Include database connection file
require_once "includes/connection.php";
if ($_SERVER["REQUEST_METHOD"] == "POST") {
// Retrieve the email address from the form
$email = isset($_POST['email_address']) ? $_POST['email_address'] : '';
// Validate and sanitize the email address if needed
// Insert the data into the 'contact' table
$query = "INSERT INTO `contact` (`email`, `timestamp`) VALUES (?, NOW())";
$insertStmt = $conn->prepare($query);
if ($insertStmt) {
$insertStmt->bind_param("s", $email);
$result = $insertStmt->execute();
if ($result) {
// Insertion successful
echo "
<script>alert('Email submitted successfully!');
window.location.href='contact.php';
</script>
";
} else {
// Insertion failed
echo "
<script>alert('Error in submission!');
window.location.href='contact.php';
</script>
";
}
$insertStmt->close();
} else {
// Handle the error
die("Error preparing statement: " . $conn->error);
}
}
?>
<?php require "includes/header.php"; ?>
<section class="contact-section" id="home">
<div class="contact-container">
<div class="contact-content">
<img src="assets/images/logo.png" alt="ICON" width="70" height="70">
<br>
<h1 style="font-size:30px;">Contact Us</h1>
<br>
<h2>Address</h2>
<p>
Taaza restaurant, Stadium Link Rd, Kathrikadavu<br>
Kaloor, Kochi, Ernakulam <br>
Kerala 682017
</p>
<br>
<h2 style="font-size:30px">Contact Details</h2>
<p class="hero-text">
MOBILE: +91 7558 9513 51 | TELEPHONE: 0484-292674<br>
EMAIL : [email protected]<br>
</p>
<br>
<form action="" class="contact-form" method="POST">
<input type="email" name="email_address" aria-label="email" placeholder="Your Email Address..." required
class="email-field">
<button type="submit" class="btn">Get Response Back</button>
</form>
</div>
<figure class="hero-banner">
<iframe src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d125751.03807260178!2d76.18464664299258!3d9.957243150760043!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x3b080d5b14f1bc7d%3A0xfa43e7937b630001!2sAl%20Taza!5e0!3m2!1sen!2sin!4v1694160076193!5m2!1sen!2sin" width="700" height="600" style="border:1;" allowfullscreen="" loading="lazy" referrerpolicy="no-referrer-when-downgrade"></iframe>
</figure>
</div>
</section>
<br><br><br><br>
<?php require "includes/footer.php"; ?>