PHP code example of sameer-shelavale / multi-captcha
1. Go to this page and download the library: Download sameer-shelavale/multi-captcha library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
sameer-shelavale / multi-captcha example snippets
$captcha = new \MultiCaptcha\Captcha([
'secret'=> "your-secret-key",
] );
$captcha = new \MultiCaptcha\Captcha([
'secret'=> "your-secret-key",
'life' => 2, //number of hours the generated captcha will be valid
'customFieldName' => 'my_captcha', //this becomes the name of captcha answer field
'options' => [
'image' => [
'maxCodeLength' => 8,
'font'=>'../src/types/image/comic.ttf',
'width'=>180
]
]
] );
$captcha = new \MultiCaptcha\Captcha([
'secret'=> "your-secret-key",
'options' => [
'ascii' => [
'maxCodeLength' => 8,
'fonts'=>array(
'banner' => 4, //render with font size 4px or it becomes too big
'doom' => 8, //render with font size 8px
'small' =>'8' //render with font size 8px, "small" font is at src/types/ascii/fonts/small.flf
)
]
]
] );