Posted by Jim Carlock on 02/22/06 21:36
Looking for suggestions on how to handle bad words that might
get passed in through $_GET['item'] variables.
My first thoughts included using str_replace() to strip out such
content, but then one ends up looking for characters that wrap
around the stripped characters and it ends up as a recursive
ordeal that fails to identify a poorly constructed $_GET['item']
variable (when someone hand-types the item into the line and
makes a simple typing error).
So the next thoughts involved employing a list of good words
and if any word in the $_GET['item'] list doesn't fall into the
list of good words, then an empty string gets returned.
Any suggestions on how to handle this?
Thanks,
Jim Carlock
[Back to original message]
|