I am an amateur web designer, I have searched on stackoverflow.com and other websites and have found many fixes for this issue I\'m having, but none of them have worked (probabl
An even simpler approach that works for me. Literally all spam that I receive(d), had a url in the message. So I filter on that, and have not received any spam messages since. I used to get about 10 a week.
Add this under your line $error_message = ""; in your php-file:
if(preg_match('/http|www/i',$comments)) {
$error_message .= "We do not allow a url in the comment.
";
}
The /i in the preg_match makes it case independent. The 'http' also filters for 'https'.