Skip to content

Commit

Permalink
Create submit.php
Browse files Browse the repository at this point in the history
  • Loading branch information
lenbot7 authored Apr 29, 2024
1 parent 102ba37 commit f04757e
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions submit.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$name = $_POST['name'];
$email = $_POST['email'];
$message = $_POST['message'];

// Email address to send the form submission
$to = "[email protected]";

// Subject of the email
$subject = "Warhammer Website Contact Form Submission";

// Compose the message
$email_message = "Name: $name\n";
$email_message .= "Email: $email\n\n";
$email_message .= "Message:\n$message\n";

// Send the email
$headers = "From: $name <$email>";
if (mail($to, $subject, $email_message, $headers)) {
echo "<p>Thank you for your message! We'll get back to you shortly.</p>";
} else {
echo "<p>Oops! Something went wrong. Please try again later.</p>";
}
} else {
echo "<p>Access denied. Please submit the form from the website.</p>";
}
?>

0 comments on commit f04757e

Please sign in to comment.