PDA

View Full Version : PHP code for a honeypot spam trap?



Alsoknownas
28-Oct-2007, 12:28 AM
Hello,

I run the website of a small non-profit that's recently been attacked by some kind of spambot via its comment form. I've done a lot of research to see what I should do about this and really like the idea of hiding a form field and requiring that the field be empty in order for the form to be processed (some are calling this a honeypot trap). The idea is that spambots generally fill in all the fields that they see in the code and will fill in the blank one, but real users will not see the field and it will therefor remain empty.

Anyway, I'd like to give it a go instead of a captcha method, but I'm not sure how to adapt my php code to reject the empty field. Any ideas? I can program html & css, but am not very familiar with php...hence using this wonderful tectite code...

russellr
29-Oct-2007, 10:01 PM
Hi,

You can just create the field in question (maybe use CSS to hide it but make it a normal text field) and then use FormMail's "required" or "conditions" feature to check that it's empty.

You don't need to write PHP code.

Alsoknownas
30-Oct-2007, 12:24 AM
Thanks, Russel! I tried some conditions and requireds, but they weren't working for some reason, so I went and tried Nick's suggestion. I'm either getting all bad-url page (with the require one) or all good_url (with the condition and ini method). Still trying though, thanks for your help!