-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcontact.php
43 lines (32 loc) · 1.38 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
<?php include('./includes/header.php'); ?>
<main class="container">
<h1>Contact Me</h1>
<div class="container mt-5 col-10 col-md-8 col-lg-6 col-xl-5">
<form method="POST" action="contact.php">
<input id="name" name="name" type="text" class="feedback-input" placeholder="Name"/>
<input id="email" name="email" type="text" class="feedback-input" placeholder="Email" />
<textarea id="message" name="message" class="feedback-input" placeholder="Comment"></textarea>
<input type="submit" value="SUBMIT" />
</form>
</div>
<?php if ($_SERVER['REQUEST_METHOD'] == 'POST'): ?>
<div class="container mt-3 col-10 col-md-8 col-lg-6 col-xl-5">
<div class="alert alert-success" role="alert">
<?php
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
// Обробка форми
$name = $_POST['name'];
$email = $_POST['email'];
$message = $_POST['message'];
// Просте виведення
echo "<h3>Your message sended!</h3>";
echo "<p>Name: $name</p>";
echo "<p>Email: $email</p>";
echo "<p>Comment: $message</p>";
}
?>
</div>
</div>
<?php endif; ?>
</main>
<?php include('./includes/footer.php'); ?>