Circunspecter's stuff
PHP Captcha system (session based): configurable look and different validation modes.
Instantiation:
$captcha = new \GrindNous\Captcha\Captcha();// Customize
$captcha = new \GrindNous\Captcha\Captcha(array(
'property' => 'value'
));Accessing properties:
// Get property
$captcha->prop('property');// Set property
$captcha->prop('property', 'value');Show captcha:
// captcha-generator.php
$captcha->render();
// captcha-request-page.php
<img src="captcha-generator.php" />// captcha-request-page.php
$encodedImage = $captcha->base64();
echo '<img src="'.$encodedImage.'" />';Validation:
// verify-page.php
if(\GrindNous\Captcha\Captcha::valid( $userPostedData ))
// Valid
else
// Not validSpecifying the captcha to validate:
// verify-page.php
if(\GrindNous\Captcha\Captcha::valid( $userPostedData, $captchaName ))Default : 'default'
Options : stringDefault : normal
Options : normal | ghost | strikethrough | notStrikethroughDefault : true
Options : boolDefault : 10
Options : intDefault : 600
Options : intDefault : 140
Options : intDefault : 60
Options : intDefault : 'png'
Options : 'jpeg' | 'gif' | 'png'Default : '#fff'
Options : string | arrayDefault : '#333'
Options : string | arrayDefault : true
Options : boolDefault : '#333'
Options : string | arrayDefault : true
Options : boolDefault : '#333'
Options : string | arrayDefault : 2
Options : intDefault : true
Options : boolDefault : '#333'
Options : string | arrayDefault : 4
Options : intDefault : 'ttf_molten/molten.ttf'
Options : stringDefault : 22
Options : intDefault : 0
Options : int1 Each type of question will affect the valid response.

textColor).ghostTextColor).2 Hexadecimal color value, string of comma separated RGB values or indexed array with RGB values.
3 The font will be searched in the "fonts" folder starting from the location of the class file.
comments powered by Disqus