-
-
Save Archie22is/eae8467b4cae4272dd15275a9a4d7ff8 to your computer and use it in GitHub Desktop.
Super simple PHP contact form in one file
This file contains hidden or 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
<html> | |
<head> | |
<title>Contact Us</title> | |
</head> | |
<body> | |
<?php | |
if ($_POST['message']) { | |
$message = $_POST['message']; | |
$email = $_POST['email']; | |
$name = $_POST['name']; | |
$headers = "From: ".$name."<".$email.">"; | |
mail('[email protected]', "Contact from RRR", $message, $headers) | |
echo "Thanks for contacting us!<br /><br />"; | |
} | |
?> | |
<form action="" method="post"> | |
Name<br /> | |
<input type="text" name="name" /> <br /> | |
Email<br /> | |
<input type="text" name="email" /><br /><br /> | |
Message<br /> | |
<textarea name="message" cols="50" rows="5"></textarea> | |
</form> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment