-
-
Save sagakom/e7382cfddc22cb3c5ec8b5c31d4cb54c to your computer and use it in GitHub Desktop.
PHP Mail Form
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
<!-- CONTACT.HTML --> | |
<form method='post' action='mailform.php'> | |
Email: <input name='email' type='text' /><br /> | |
Subject: <input name='subject' type='text' /><br /> | |
Message:<br /> | |
<textarea name='message' rows='15' cols='40'> | |
</textarea><br /> | |
<input type='submit' /> | |
</form> | |
<!-- MAILFORM.PHP --> | |
<?php | |
if (isset($_REQUEST['email'])) { | |
$email = $_REQUEST['email'] ; | |
$subject = $_REQUEST['subject'] ; | |
$message = $_REQUEST['message'] ; | |
mail("someone@example.com", $subject, | |
$message, "From:" . $email); | |
echo "Merci! Votre requête a été soumise à notre webmestre."; | |
} else { | |
echo "Erreur: Prière de remplir le formulaire."; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment