Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Latest commit 781730e @msadouni initial commit
Failed to load latest commit information.
controllers/components initial commit
views/helpers initial commit initial commit

This plugin provides a simple antispam for your forms. It adds fields you can hide with CSS to indicate if a form is submitted by a bot.


  • Clone from github : in your plugins directory type

    git clone git:// antispam

  • Download an archive from github and extract it in plugins/antispam


Add the component and helper in your controller :

var $components = array('Antispam.Antispam');
var $helpers = array('Antispam.Antispam');

Add the antispam fields in your view :

echo $this->Form->create('Post');
echo $this->Antispam->fields();
echo $this->Form->inputs();
echo $this->Form->submit();
echo $this->Form->end();

Hide the fields in CSS :

.n-a-s { position:absolute; left:-9999px; }

Then before saving your data :

if ($this->Antispam->isSpam($this->data)) {
    // redirect to a success page to trick the bot
    // or send yourself an email
    // or log the spam for further reviewing
    // or do whatever you want
} else {


Something went wrong with that request. Please try again.