Jump to content

content filter


yoshida
 Share

Recommended Posts

Hi. I'm working on an antispambot script for my guestbook, based on a content filter amongst some other tricks.How would I match a message to a blacklist and stop it from getting processed if it contained certain words? Also: how would I randomize field names so spambots can't 'remember' in which field to post? (I'd also generate some fields hidden by css ofcourse, to lure spambots into using it).Jolly long easter weekend. :)

Link to comment
Share on other sites

If you want to have a list of banned words, set up an array or something with the words in it. There are several functions you can use to help check, look at the array functions on php.net to see what is available. Worst case, you can just loop through and use strpos to look for each one. Or you can group them all into a single regular expression and use that. Either way, you're really just checking if one string exists in another one, and you can find all the functions you need in the array and string sections on php.net.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...