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 | |
//Email Form Process | |
if ($_SERVER["REQUEST_METHOD"] == "POST") { | |
//var_dump($_POST); //testing | |
// PHP Email Form Sanitizer + SPAM Bot Honeypot | |
// Email header injection exploit code explained at | |
// http://www.nyphp.org/phundamentals/8_Preventing-Email-Header-Injection |
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
*~ | |
.DS_Store | |
.svn | |
.cvs | |
*.bak | |
*.bak.* | |
*.swp | |
*.swo | |
*.swm | |
*.swn |
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 Email Form Sanitizer + SPAM Bot Honeypot | |
// Email header injection exploit code explained at http://www.nyphp.org/phundamentals/8_Preventing-Email-Header-Injection | |
// Add hidden honeypot div to your form | |
foreach( $_POST as $value ){ | |
if (stripos($value, 'Content-Type:') !== FALSE || !empty($_POST["spam_bot_honeypot"])) { | |
echo "There was a problem with the information you entered."; | |
exit; | |
} | |
} | |
<!-- SPAM Bot Honey Pot --> |