|
Posted by Richard Lynch on 10/07/79 11:08
I got trigger happy and deleted the post requesting info on interesting
ideas for form checking.
To stop the automated link farms from trying to insert their stupid crap
into your guestbook/blog/whatever, you may want to experiment with
something like:
if (strlen($message) / strlen(strip_tags($message)) > 1.3){
//ignore bogus HTML post
}
You still want to sanitize the HTML content, of course, but this gets rid
of those annoying pointless posts. At least, it has so far for me...
Vary 1.3 depending on your current (clean) data. Run a quick PHP script
to suck down all the entries, and compute the ratio (as above) for each,
and keep track of the highest ratio of html to text.
Then choose a number higher than your highest ratio so far, and run with
it for awhile.
--
Like Music?
http://l-i-e.com/artists.htm
[Back to original message]
|