PhpRiot
Become Zend Certified

Prepare for the ZCE exam using our quizzes (web or iPad/iPhone). More info...


When you're ready get 7.5% off your exam voucher using voucher CJQNOV23 at the Zend Store

Submitting known spam

Spam data will occasionally get through the filter. If you discover spam that you feel should have been caught, you can submit it to Akismet to help improve their filter.

Zend_Service_Akismet::submitSpam() takes the same data array as passed to isSpam(), but does not return a value. An exception will be raised if the API key used is invalid.

Example 708. submitSpam() Usage

<?php
$data 
= array(
    
'user_ip'              => '111.222.111.222',
    
'user_agent'           => 'Mozilla/5.0 (Windows; U; Windows NT 5.2;' .
                              
'en-GB; rv:1.8.1) Gecko/20061010 Firefox/2.0',
    
'comment_type'         => 'contact',
    
'comment_author'       => 'John Doe',
    
'comment_author_email' => 'nospam@myhaus.net',
    
'comment_content'      => "I'm not a spammer, honest!"
);
$akismet->submitSpam($data));

submitSpam() implements the submit-spam Akismet API method.

Zend Framework