Last active
September 6, 2020 02:42
-
-
Save manmar/30424fcc126bc98f0337635688f56935 to your computer and use it in GitHub Desktop.
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
<?php | |
$name = Trim(stripslashes($_POST['name'])); | |
$email = Trim(stripslashes($_POST['email'])); | |
$message = Trim(stripslashes($_POST['message'])); | |
// validation | |
$validationOK=true; | |
if (!$validationOK) { | |
print "<meta http-equiv=\"refresh\" content=\"0;URL=error.html\">"; | |
exit; | |
} | |
$formcontent=" Name: $name \n E-Mail: $email \n Message: $message"; | |
$recipient = "[email protected]"; | |
$subject = "Contact Form"; | |
$mailheader = "From: $email \r\n"; | |
// anti spam (hidden url input) | |
if(isset($_POST['url']) && $_POST['url'] == ''){ | |
$success = mail($recipient, $subject, $formcontent, $mailheader); | |
} | |
if ($success){ | |
print "<meta http-equiv=\"refresh\" content=\"0;URL=danke.html\">"; | |
} | |
else{ | |
print "<meta http-equiv=\"refresh\" content=\"0;URL=error.html\">"; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment