Created
July 14, 2020 05:51
-
-
Save iamrobert/dc59aa3ff8e99d9357c4d28745878039 to your computer and use it in GitHub Desktop.
rsform honeypot
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
$spam = false; | |
if($_POST['form']['HoneyPotFieldName'] != '') { | |
$spam = true; | |
} | |
if (preg_match( "/bcc:|cc:|multipart|\[url|Content-Type:/i", implode($_POST['form']))) { | |
$spam=true; | |
} | |
// Detect more than 3 outgoing links | |
if (preg_match_all("/<a|https?:/i", implode($_POST['form']), $out) > 3) | |
{ | |
$spam=true; | |
} | |
if ($spam) | |
{ | |
exit('We are unable to process your request - please contact us in other ways'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment