I had a request the other day to write a spam filter for a standard contact form. Thanks to wordpress I’ve been made aware of the excellent spam filtering service offered by Akismet.com. What’s even better, is that an Akismet Service class has been added to the Zend Framework – allowing for easy integration into one’s PHP projects.
The code posted below makes the following assumptions :
- You have an Akismet API key
- You have the Zend Framework installed and configured correctly : click here for documentation
- You have written the form HTML, the form has been submitted and all input data has been sanitized (make sure to read the comments).
- You know how to use the php mail() function or have an equivalent method
This is of course a very basic example, and only touches on the isSpam() method provided by the class. The real power is actually…
View original post 16 more words