Getting Started

Start using CTection WebCaptcha right away!

Step 1. Client Side Elements

Include the WebCaptcha Client-side JavaScript file and insert a Captcha Element in your form. The script will then automatically insert a captcha image and input field into the ctec_captcha div. User input for the captcha is provided via parameter "ctec_captcha_txt_{x}" where {x} is the number of the captcha element, starting at 0.
<!DOCTYPE html>
  <title>CTection WebCaptcha Test</title>
  <form action="process.php" method="post">
   <div class="ctec_captcha"></div>
   <button type="submit">Go!</button>
 <script src=""></script>

Step 2. Server Side Parsing

Contact our API to check the validity of the code entered in the form. You can also use one of our libraries to make checking captcha validity easier. The parameter names for the captcha fields are "ctec_captcha_txt_{x}" and "ctec_captcha_vc_{x}" for the user input and captcha id respectively. A URI of the page containing the captcha has to be passed to prevent cross-site CAPTCHAs.
 $api_ret = json_decode(file_get_contents("".urlencode($_POST["ctec_captcha_txt_0"])."&uid=".urlencode($_POST["ctec_captcha_vc_0"])."&uri=".urlencode("")),true);
   echo "Captcha Valid";
   echo "Captcha Invalid";
PHP Example Code