PDA

View Full Version : captcha security


mustangdesigner
03-04-2014, 08:35 PM
Any suggestions as to the best way to add captcha security to my basic PHP contact form? I need something very basic as I have limited experience in code.

edbr
03-05-2014, 03:33 AM
there are afew captcha scripts around, recaptcha seems popular.
another way is to add a honey trap to work against robots. This is mentioned here so please do a search for it.
I add it to my scripts now as a secondary method. in its simplest form add a hidden field in your form. in the following example called agree<input type="hidden" name="agree" value="" />

then in your mail handling script, and this can be at the start if you wish

if(!empty($_POST['agree']))
{
header('Location: index.php');
exit;
}