Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
stuffbymax authored Feb 27, 2024
1 parent c303bcd commit 5b5ff34
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 1 deletion.
1 change: 1 addition & 0 deletions contact.html
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ <h1>stuffbymax</h1>
<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>
Expand Down
57 changes: 56 additions & 1 deletion testing.txt
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>




0 comments on commit 5b5ff34

Please sign in to comment.