-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c303bcd
commit 5b5ff34
Showing
2 changed files
with
57 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,56 @@ | ||
<a href="https://github.com/justmaxcz?tab=repositories" target="_blank">Visit Example Website</a> | ||
php | ||
|
||
<?php | ||
if ($_SERVER["REQUEST_METHOD"] == "POST") { | ||
$name = $_POST["name"]; | ||
$email = $_POST["email"]; | ||
$message = $_POST["message"]; | ||
|
||
$to = "heroesbiggie@gmail.com"; | ||
$subject = "New Contact Form Submission"; | ||
$body = "You have received a new message from the contact form:\n\n" . | ||
"Name: $name\n" . | ||
"Email: $email\n" . | ||
"Message:\n$message\n"; | ||
$header = "From: $name <$email>\r\n" . | ||
"Reply-To: $email\r\n" . | ||
"X-Mailer: PHP/" . phpversion(); | ||
|
||
if (mail($to, $subject, $body, $header)) { | ||
echo "Message sent successfully!"; | ||
} else { | ||
echo "An error occurred while trying to send the message."; | ||
} | ||
} | ||
?> | ||
|
||
html | ||
|
||
<div class="container"> | ||
<section class="contact"> | ||
<div class="center"> | ||
<h2 class="section-heading" >form</h2> | ||
</div> | ||
<form method="post" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>"> | ||
<form id="contact_form" method="post"> | ||
<div class="form-group"> | ||
<label for="name">Name:</label> | ||
<input type="text" class="form-control" id="name" name="name" required> | ||
</div> | ||
<div class="form-group"> | ||
<label for="email">Email:</label> | ||
<input type="email" class="form-control" id="email" name="email" required> | ||
</div> | ||
<div class="form-group"> | ||
<label for="message">Message:</label> | ||
<textarea class="form-control" id="message" name="message" rows="5" required></textarea> | ||
</div> | ||
<button type="submit" class="btn btn-primary" id="submit">Submit</button> | ||
</form> | ||
|
||
|
||
</div> | ||
|
||
|
||
|
||
|