-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcontact.html
59 lines (48 loc) · 1.81 KB
/
contact.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Contact</title>
<link rel="stylesheet" href="contact.css">
<script src="validate.js"></script>
</head>
<body>
<div class="home">
<a href="./index.html"><img src="./images/home.png" alt=""></a>
</div>
<section id="contact">
<div class="container">
<center><h1>Contact Me</h1></center>
<form method="post" action="send-email.php" onsubmit="return validateForm()">
<label for="name">Name:</label>
<input type="text" id="name" name="name" placeholder="Your name" required>
<label for="email">Email:</label>
<input type="email" id="email" name="email" placeholder="Your email" required>
<label for="message">Message:</label>
<textarea id="message" name="message" placeholder="Type your message here" required></textarea>
<center><button type="submit">Send</button></center>
</form>
</div>
</section>
</body>
</html>
<!-- <?php
if(isset($_POST['submit'])) {
// Collect form data
$name = $_POST['name'];
$email = $_POST['email'];
$message = $_POST['message'];
// Set up email
$to = 'your-email@example.com';
$subject = 'New Message from Your Website';
$message_body = "Name: $name\n\nEmail: $email\n\nMessage:\n$message";
// Send email
if(mail($to, $subject, $message_body)) {
echo 'Thank you for your message!';
} else {
echo 'There was a problem sending your message. Please try again.';
}
}
?> -->