|Liam Delahunty: Home||Tips||Web||Contact|
Think I deserve a present? See my Amazon Wish List
PHP URL Count Check for Comment Spam
This simple little bit of code can be added to your spam filtering section on your contact forms, it checks for "http", "href" and "[url" in the message block. It counts them and repors them. It could be used within a spam detection routine on a form to filter away all those annoying "Your site is great" messgae that arrive with a dozen links in them...
Here's the ever so simple code:
Now simply check the values of $http, $href and $url and if beyond your limit, mark the message as spam. Here's a form for you to paste in some spam and see it in action.