Note that there are some explanatory texts on larger screens.

plurals
  1. POcakephp form getting spammed - how?
    primarykey
    data
    text
    <p>I have a simple cakephp form WITH validation that submits to a database. It doesn't require a logged in user.</p> <p>No using the form normally via a browser and not filling in all required fields causes validation errors and the form is not submitted.</p> <p>However, I seem to be getting spammed by someone/something. They are filling the generic named fields (name,email,message etc) but not the obscure ones and these records are going into the database so they're obviously bypassing the validation!</p> <p>My question is HOW??? (and how can I stop them?)</p> <p>I have the feeling I'm missing an obviously loop hole or something...</p> <p>This is my add method:</p> <pre><code> function add() { $this-&gt;pageTitle = 'Projects - Submit Project'; if (!empty($this-&gt;data)) { $this-&gt;Project-&gt;create(); if ($this-&gt;Project-&gt;save($this-&gt;data)) { $this-&gt;Session-&gt;setFlash(__('The Project has been saved', true)); $this-&gt;_sendStaffMail($this-&gt;Project-&gt;id); $this-&gt;_sendClientMail($this-&gt;Project-&gt;id); $this-&gt;redirect(array('controller' =&gt; 'pages', 'action'=&gt;'thanks')); } else { $this-&gt;Session-&gt;setFlash(__('The Project could not be saved. Please, try again.', true)); } } } </code></pre> <p>And validation from Model:</p> <pre><code> var $validate = array( 'name' =&gt; array('notempty'), 'department' =&gt; array('notempty'), 'client' =&gt; array('notempty'), 'contact_name' =&gt; array('notempty'), 'email' =&gt; array('email'), 'phone' =&gt; array('notempty'), 'title' =&gt; array('notempty'), 'background' =&gt; array('notempty'), 'objectives' =&gt; array('notempty'), 'target_audience' =&gt; array('notempty'), 'message' =&gt; array('notempty'), 'logos' =&gt; array('notempty'), 'images' =&gt; array('notempty'), 'print_info' =&gt; array('notempty') ); </code></pre> <p>I should also mention I have tried playing with the Security component but it seems over kill when my project has tons of forms throughout it (altho they're behind Auth login)</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload