-
-
Save tcdevs/7fcfa890e7daa5496ede to your computer and use it in GitHub Desktop.
PHP Mail Form
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
| <!-- 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