PHP library for Civil Rights Defenders CAPTCHA.
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


PHP library for Civil Rights Defenders CAPTCHA. Using a library is the simplest way to add the Civil Rights CAPTCHA to your site.

There is a Wiki at

The package includes the library and an example page to demonstrate how to use it. The Civil Rights CAPTCHA depends on the javascript library jQuery.

Step 1: Displaying the CAPTCHA

To display the captcha in your html form, simply echo the show() function at the place in the <form> where you want the captcha to display.

$crccaptcha = new civilrightscaptcha();
//To set language use (Sets to Swedish, default is english): 
echo $crccaptcha->show();

A form with the CAPTCHA could look something like this.

  <script src='' type='text/javascript'></script>
    <!-- your HTML content -->
    <form method="post" action="verify.php">
      <!-- your form inputs -->
          $crccaptcha = new civilrightscaptcha();
          echo $crccaptcha->show();
      <input type="submit" />
    <!-- more of your HTML content -->

Notice that the require_once() expects the library file to be in the same catalog as your script. If it is not, you must link approperiately. The jQuery library must be included for the captcha to function.

Step 2: Verifying the entered answer

After the form has been submitted to your form-proccessing-php-file, you must verify that the user entered the correct answer.

$crccaptcha = new civilrightscaptcha();
if($crccaptcha->check($_POST['crc_captcha'], $_POST['crc_sessid'])) {
    //Your code if the user entered the correct answer!
else {
    //Your code if the user entered the wrong answer!

When the user submits the form, two fields (crc_captcha & crc_sessid) are also submitted from the captcha. Both these have to be used as parameters to the check function. The check function returns a boolean TRUE if the answer is correct and FALSE if it is not.

see for more information.