Aller au contenu principal

captcha

Implement functions for captcha.

CAPTCHA

NAME

captcha - Implement functions for captcha.

SYNOPSIS

ct([length:integer,width:integer,height:integer,bgcolor:string,fgcolor:string]);

DESCRIPTION

This function is used to implement a captcha. A CAPTCHA (an acronym for "Completely Automated Public Turing test to tell Computers and Humans Apart") is a type of challenge-response test used in computing to determine whether or not the user is human. The term was coined in 2000[1] by Luis von Ahn, Manuel Blum, Nicholas J. Hopper of Carnegie Mellon University and John Langford of IBM.[2] The most common type of CAPTCHA was first invented by Mark D. Lillibridge, Martin Abadi, Krishna Bharat and Andrei Z. Broder. This form of CAPTCHA requires that the user type the letters of a distorted image, sometimes with the addition of an obscured sequence of letters or digits that appears on the screen. Because the test is administered by a computer, in contrast to the standard Turing test that is administered by a human, a CAPTCHA is sometimes described as a reverse Turing test. This term is ambiguous because it could also mean a Turing test in which the participants are both attempting to prove they are the computer (en.wikipedia.org/wiki/CAPTCHA)

PARAMETERS

length
Length of captcha. Default is 8 characters.
width
Width of captcha. Default is 140px.
height
Height of captcha. Default is 25px.
fgcolor
Text color of captcha. Default is white.
bgcolor
Background color of captcha. Default is #2b84c0.

RETURN

array
An array with the image encoded in base64 and the value of the captcha in md5 format.

EXAMPLES

{{ %include "/extenso/functions/captcha.snc";  }}

\{{ c=captcha();}}
<img src="\{{c[0]}}">
<input type="hidden" name="captcha" value="\{{c[1]}}">
<input type="text" name="guess" value="">


if md5(cgidata.guess) eq cgidata.captcha then
        "ok";
else
        "Is this a robot?";
endif

SEE ALSO

AUTHOR

Written by Pierre Laplante, <laplante@sednove.com>

MODIFICATIONS

1.0 2014-09-09 21:24:14 laplante@sednove.com

Edit

© 2024 extenso Inc. All rights reserved.