Friendly, easy, lightweight, self-hostable CAPTCHA service.
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
Skylar Ittner 987639decd Add index.html webpage il y a 1 an
db_upgrade Add (much) better text questions. il y a 2 ans
images Initial commit il y a 2 ans
nbproject Initial commit il y a 2 ans
.gitignore Initial commit il y a 2 ans
LICENSE Wrap text in license file il y a 1 an
api.php Fix a thing il y a 2 ans
captcheck.css Override website theme link borders il y a 2 ans
captcheck.dist.js Add support for nonces (put data-stylenonce="NONCE" on the div) il y a 1 an
captcheck.js Add support for nonces (put data-stylenonce="NONCE" on the div) il y a 1 an
composer.json Initial commit il y a 2 ans
composer.lock Initial commit il y a 2 ans
database.mwb Add (much) better text questions. il y a 2 ans
database.sql Add (much) better text questions. il y a 2 ans
index.html Add index.html webpage il y a 1 an
index.php Use event handlers instead of onClick and onEnter, for strict CSPs il y a 2 ans
logo.png Add logo il y a 2 ans Update readme il y a 1 an
required.php Update readme, add SQL code, remove unused function in required.php il y a 2 ans
scrapetexts.php Add (much) better text questions. il y a 2 ans
settings.template.php Automatically delete old sessions il y a 2 ans
test.html Add accessible format, add support for multiple CAPTCHAS on a page (use class instead of id for container) il y a 2 ans
test.php Make sure question text is black, improve test sample il y a 2 ans


Easy, light, self-hostable CAPTCHA service. Works on modern browsers (and IE9+). Uses a selection of icons from Font-Awesome. Text-only accessibility mode and support for keyboard-only operation.

Thanks to for supplying the data for the text CAPTCHA.

How to use

In your form, put an empty div with the class “captcheck_container”. Add captcheck.js (or captcheck.dist.js) into your page.

<!DOCTYPE html>
        <title>Captcheck Sample Form</title>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <script src="captcheck.js"></script>
        <form action="submit.php">
            <input type="text" name="form_field" placeholder="Some random form field" />
            <div class="captcheck_container">
            <button type="submit">Submit Form</button>

When the form is submitted, your server will receive two extra form fields: captcheck_session_code and captcheck_selected_answer. In your form handling code, send a request to http(s)://captcheck-url/api.php. Pass the variables session_id and answer_id with the values sent with the form, and also pass the variable action with the value verify. You will receive a JSON response with (among other things) "result": true or "result": false. If result is false, the user failed the test, and another variable msg is available with an explanation.

Example URL: http(s)://captcheck-url/api.php?action=verify&session_id=<captcheck_session_code>&answer_id=<captcheck_selected_answer>

Example responses: {"session":"some_session_id","result":true} {"session":"some_session_id","result":false,"msg":"Answer incorrect."}

###Content-Security-Policy and Nonces

Add data-stylenonce="nonce_here" to the .captcheck_container div. If you have multiple CAPTCHAs on one page, only one of them needs the nonce specified.


  1. Run composer install.
  2. Copy settings.template.php to settings.php and plug in your settings.
  3. Install the database.
  4. Customize captcheck.js with the correct api_url.
  5. Follow the How to Use section and the example setup in test.html and test.php.

Execution Flow

JS = captcheck.js, API = api.php, FORM = parent form,
SITE = form processing code, -> = some action taken on the right by the left

JS -> API:      Request session ID, question, and answers (with scrambled random codes)
API -> JS:      Sends info, saves session ID, correct answer, and scrambled answer codes in DB
JS -> API:      Requests answer images by sending scrambled value and session ID
JS -> FORM:     Adds hidden field with value=session ID, displays question and images (or text box)
SITE -> API:    Sends session ID and answer
API -> SITE:    Responds with true/false to indicate if the answer is valid, marks session as expired to prevent CAPTCHA reuse