Form checking

From: Date: Mon, 14 Feb 2005 18:54:39 +0000
Subject: Form checking
Groups: php.general 
Request: Send a blank email to php-general+get-208676@lists.php.net to get a copy of this message
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

« previous php.general (#208676) next »