theodorejb/responsive-captcha 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

theodorejb/responsive-captcha

Composer 安装命令:

composer require theodorejb/responsive-captcha

包简介

Generate mobile-friendly, accessible CAPTCHAs

README 文档

README

Packagist Version

Prevent form spam by generating random, accessible arithmetic and logic questions.

Examples:

  • "What is the fourth letter in snowboard?"
  • "What is the sum of four and six?"
  • "What is eight multiplied by two?"
  • "Which is smallest: sixty-six, one hundred, or twenty-two?"

Users can respond with either the numeric or textual version of an answer (e.g. "16" or "sixteen").

For background info on this project, see my blog post: https://theodorejb.me/2012/12/30/responsive-captcha/

Install via Composer

composer require theodorejb/responsive-captcha

Usage

  1. Generate a random question:

    use function theodorejb\ResponsiveCaptcha\{randomQuestion, checkAnswer};
    
    $qa = randomQuestion();
    $realAnswer = $qa->getAnswer(); // save somewhere (e.g. in session or encrypted single-use token)
  2. Display question in form:

    <label>
        <?= $qa->getQuestion() ?>
        <input type="text" name="captcha" />
    </label>
  3. Check whether the user's response is correct:

    $answer = filter_input(INPUT_POST, "captcha");
    
    if ($answer !== null) {
        if (checkAnswer($answer, $realAnswer)) {
            // code to execute if the captcha answer is correct
        } else {
            // the answer is incorrect - show an error to the user
        }
    }

统计信息

  • 总下载量: 35
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 11
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 11
  • Watchers: 5
  • Forks: 6
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2014-09-22

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固