S2OJ/web/app/controllers/captcha.php

12 lines
295 B
PHP
Raw Normal View History

2022-03-14 13:49:48 +00:00
<?php
use Gregwar\Captcha\PhraseBuilder;
use Gregwar\Captcha\CaptchaBuilder;
2022-03-25 05:21:29 +00:00
$builder = new CaptchaBuilder(null, new PhraseBuilder(4, "2345678abcdefhkmnrstuxz"));
2022-03-14 13:49:48 +00:00
$builder->build();
$_SESSION['phrase'] = $builder->getPhrase();
header('Content-Type: image/jpeg');
$builder->build()->output();