Created
July 11, 2017 15:48
-
-
Save btr2/e255ab06b5380767746e0860084fa8b5 to your computer and use it in GitHub Desktop.
Example of a honeypot in a PHP contact 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
<?php | |
// if the honeypot field is empty | |
if(isset($_POST['honeypot']) && $_POST['honeypot'] == ''){ | |
// Then continue with formatting your email | |
.......... | |
} | |
// otherwise, let the spammer think that they got their message through | |
echo "Message sent"; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment