CAPTCHA-Hosted

Our CAPTCHA service is designed as an alternative to JavaScript based CAPTCHAs as well as providing addionial reporting on your forms performance.

How to use

We have made our CAPTCHA system nice and easy to integrate into your code. The first step is to copy the line of code below to render the CAPTCHA image onto your website:

<img src="https://smurl.be/captcha/image/$SESSIONIDorUUID" />

You will need to replace $SESSIONIDorUUID with a unique ID such as a session ID or a UUID. See below code examples:

PHP
<?php echo session_id() ?>
CFML: ColdFusion / Lucee / Railo
<cfoutput>#CreateUUID()#</cfoutput>

If you have a PRO account and wish to add tracking to your CAPTCHAs please add your CAPTCHA public key (found in your settings) onto the URL path to the image as shown below:

<img src="https://smurl.be/captcha/image/$SESSIONIDorUUID/public-key/" />

This will generate a CAPTCHA image:

Now that you have a CAPTCHA image you will need to add a form input field within your form. You will also need to create a hidden field to pass the session ID or UUID to your backend script to verify to the answering service. This can be named anything you wish as the submission handler will be controlled by your backend code.

<input name="captcha" type="text"/>
<input name="captcha-uuid" type="hidden" value="00-My-UUID-00" />

In your backend script you will need to run a HTTP call to our answering service to verify the response. Below are examples on how to handle this:

PHP (CURL)
<?php
$url = "https://smurl.be/captcha/answer/".htmlspecialchars($_POST["captcha-uuid"])."/".htmlspecialchars($_POST["captcha"]);

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_GET, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$answerdata = curl_exec($ch);
if (curl_error($ch)) die("Connection Error: ".curl_errno($ch).' - '.curl_error($ch));
curl_close($ch);

print_r($answerdata);

$arr = json_decode($answerdata); # Decode JSON String
print_r($arr); # Output XML Response as Array
?>
CFML: ColdFusion / Lucee / Railo
<cfhttp method="GET" url="https://smurl.be/captcha/answer/#FORM.captcha-uuid#/#FORM.captcha#" >
<cfdump var="#DeserializeJSON(CFHTTP.FileContent)#">

The return data from the answer service will provide a status and message. If the status is '200' that means the CAPTCHA was answered correctly.

Case Sensitivity

With the latest version of the CAPTCHA-Hosted service you can turn off the case sensitivity for the answers service. To do this you only need to add 'false' to the end of the answer HTTP call. By default the value is true to apply case sensitive check. For example in PHP your code will look like this:

<?php
$url = "https://smurl.be/captcha/answer/".htmlspecialchars($_POST["captcha-uuid"])."/".htmlspecialchars($_POST["captcha"])."/false";

An API that is a developers best friend

We have developed a powerful API that can be integrated into any application. With our easy to follow documentation and example code, our API is everything you want.

View details »