Skip to content
/ gmCaptcha Public

A small and simple Proof-of-Concept of Captcha (graphical and mathematical) for use in a form generic or in contacts form.

License

Notifications You must be signed in to change notification settings

A35G/gmCaptcha

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

60 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gmCaptcha

A small and simple Proof-of-Concept of Captcha (graphical and mathematical) for use in a form generic or in contacts form.

Usage

  • Install Composer

  • Run the following command at the root level of your project:

    composer install
    
  • Include gmCaptcha.js (or gmCaptcha.min.js) file from "public/assets/js" directory

    <script src="./public/assets/js/gmCaptcha.js" type="text/javascript"></script>
  • Make new instance

    <script type="text/javascript">
    new gmCaptcha()
    </script>
  • Call the type of desiderated Captcha:

    Type Call Example
    Graphical Captcha - Mathematical operation new gmCaptcha({extra: {style: "math"}})
    Graphical Captcha - Mathematical operation with sign specification new gmCaptcha({extra: {style: "math",custom: 3}})
    Textual Captcha - Mathematical Operation new gmCaptcha({type: "text"})
    Textual Captcha - Mathematical Operation with sign specification new gmCaptcha({type: "text",extra: {custom: 4}})
    Graphical Captcha - Text (random or from Dictionary file) with Text to Speech and Refresh (generation of a new code) new gmCaptcha()

Features

  • Font customization for graphical Captchas by setting the value of the appFont key within the config file;

  • Specify the type of operation to be used in mathematical Captchas:

    • 1 for Sum;
    • 2 for Subtraction;
    • 3 for Multiplication;
    • 4 for Division;
    • 5 for Random
  • Choose whether or not to use a text file as a dictionary and preload its contents by setting the value of the appUseDictionary and appDictionaryFile keys whithin the config file;

  • Specify the minimum and maximum length of words to be taken from the dictionary:

    • ['appDictionarySettings']['minWordLength']
    • ['appDictionarySettings']['maxWordLength']
  • If you choose not to use the Dictionary, the script will generate Captcha with random text.

  • The result of mathematical operations and the text of graphical Captchas are contained in a session variable; its name can be customized by enhancing the contents of the appSessionVariable key whithin the config file.

  • TextToSpeech (It is only present in the graphical version of the Captcha and you can customize the language via the following parameter):

    <script type="text/javascript">
    new gmCaptcha({spellLang: "en-US"})
    </script>
  • Refresh captchas (It is only present in the graphical version of the Captcha);

  • Error logger.

  • Generate a captcha with random text, directly client-side and display it via HTML's Canvas element.


Note

There are several types of Captcha online, some famous, some less so, all certainly strong and functional.

Why then write "perhaps" useless code?

To "find out how it works," to learn new things, to improve, to feed on knowledge.

Any suggestion, comment or advice, is welcome.

About

A small and simple Proof-of-Concept of Captcha (graphical and mathematical) for use in a form generic or in contacts form.

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

Packages

No packages published