alikhalili / simple-captcha
简单的PHP CAPTCHA脚本
1.0.1
2017-06-27 14:09 UTC
This package is auto-updated.
Last update: 2024-09-16 03:47:24 UTC
README
此包是simple-php-captcha的修改版。
此代码是原始代码的面向对象版本。
我还尝试进行了一些小的改进(动态字体和背景图片路径)
MIT许可下发布:https://open-source.org.cn/licenses/MIT
基本用法
0 - 安装包
composer require alikhalili/simple-captcha
1- 创建CAPTCHA对象
$captcha = new Captcha();
2- 绘制图像
$captcha->config();
$image = $capthca->getImage();
//in the view
echo "<img src='$image' />";
//or in ajax response to a refresh request:
echo $image;
或验证代码
$captchaIsValid = $captcha->verify($givenCode);
感谢
- 感谢Cory LaViska提供的基础代码和Yasir M Türk提供的分支仓库。
- 特别感谢Subtle Patterns为我们提供的默认背景图案:http://subtlepatterns.com/
- 特别感谢dafont.com提供的Times New Yorker字体:http://www.dafont.com/