Form checking

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux