No description, website, or topics provided.
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

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 {