reCAPTCHA

Contacular now supports the reCAPTCHA human verification service - take a look at this demo!

This is a demonstration of the telephone callback Contacular form type, with reCAPTCHA support enabled. If you wish there is an example of the plain telephone callback form.

reCAPTCHA is a service which provides human verification for form submissions. If you wish to use this service to validate your Contacular forms are being submitted by a human, you must first sign up for reCAPTCHA, and then use the public and private keys you are given when constructing your Contacular form.

<? 
$form 
= new ContacularForm("callback");          // Create a new Contacular Form
$form->addRecipient("foobar@contacular.co.uk");  // Add a recipient

// Set reCAPTCHA public and private keys
// (keys must be set before processResponse and getCode functions are called)
$form->setRecaptchaPublicKey("6LfC5goAAAAAAIcIkd72WrqhxbSYs5P8urf--6rG");
$form->setRecaptchaPrivateKey(".oO!--loremipsumsetamit-123456789--!Oo.");

if (
$form->processResponse($_POST))              // If processed form response,
{
        echo 
"Thanks. We will call you back";    // display a relevant message.
        
echo " within the next 24 hours.";      
}
else                                             
// If response not processed,
{
        echo 
$form->getErrors();                 // show any validation errors
        
echo $form->getCode();                   // and output form HTML code.
}
?>

The inclusion of the reCAPTCHA public and private keys using the code above, generates a form with full reCAPTCHA support and functionality built in, as shown below. Feel free to test it out!

Powered by Contacular