Download the PHP package ajiho/think-captcha without Composer

On this page you can find all versions of the php package ajiho/think-captcha. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package think-captcha

think-captcha

基于thinkphp6.0.0+的一个图形验证码拓展包

效果图

优点

安装

配置

安装完毕后会自动生成配置文件 /config/captcha.php

使用

mvc开发方式

生成验证码

首先在控制器方法中生成验证码,用于给页面进行显示

检验验证码

假设前端表单传递的验证码的name值为captcha

前后端分离开发使用

流程说明

在使用之前先说一下大致流程(用登录案例说明):

  1. 客户端请求验证码接口
  2. 返回结果(展示图形验证码的url地址(指向后端的验证码展示方法)、uniqid)
  3. 把url地址赋值给img的src属性,同时把uniqid存储起来待会儿用于表单提交
  4. 当img图片显示的时候就会触发后端验证码展示方法,该接口方法会把uniqid作为键,把验证码作为值缓存起来
  5. 客户端登录信息输入完毕后携带参数(账号、密码..、验证码、uniqid)去请求登录接口
  6. 在后台登录处理方法中通过uniqid去缓存中查找对应的验证码和表单提交的验证码进行对比是否正确,至此流程结束

代码流程

1.你需要定义两个接口

如果你没有使用强制路由,可忽略,这里定义出来是为了方便说明

2.验证码接口方法

3.验证码显示方法

4.登录处理方法里面验证

反馈

如果有任何问题或者建议,可以直接到仓库留言。


All versions of think-captcha with dependencies

PHP Build Version
Package Version
Requires topthink/framework Version ^6.0 || ^8.0
ext-gd Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package ajiho/think-captcha contains the following files

Loading the files please wait ....