Download the PHP package lorddashme/php-simple-captcha without Composer
On this page you can find all versions of the php package lorddashme/php-simple-captcha. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download lorddashme/php-simple-captcha
More information about lorddashme/php-simple-captcha
Files in lorddashme/php-simple-captcha
Package php-simple-captcha
Short Description A simple captcha package that suite to any type of web application built on php.
License MIT
Homepage https://github.com/lorddashme/php-simple-captcha
Informations about the package php-simple-captcha
PHP Simple Captcha
A simple captcha package that fit to any type of web application built on php.
Sample
Requirement(s)
- PHP version from 5.6.* up to latest.
Install
- Recommended to install using Composer. Use the command below to install the package:
Usage
List of Available Functions
Function | Description |
---|---|
Execute the generation of random code base on the given length. The default length is 5. |
|
Execute the generation of image and the content will be base on the function. | |
To get the current code generated by the method. Ex. return value |
|
To get the current image generated by the function. Ex. return value |
|
Use to store the generated values in the captcha session. | |
Use to get the current stored session generated values in the captcha session. This is use to validate the generated code against the user organic inputed code. Ex. return value |
-
Basic usage:
- Also can be done by using the code below:
Captcha Session Usage
-
The package also provided a simple way to validate the user input code, for example we have a login feature.
-
Login Page:
-
Initialize the Captcha class together with the code and image generation process.
-
Use the to store the generated details in the captcha session.
-
The stored session details are essential for validating the user input later on.
-
Validation Route:
-
We need to initialize again the Captcha class but now we don't need to initialize the code and image generation.
-
Validate the user inputed captcha code.
- You may also check the sample in the root directory of the package that will show you the actual example of implementing captcha class.
-
Captcha Configuration
- To change the default config of the class:
Tips
-
Overriding the default config:
-
The and are tightly coupled in the directory structure of the package.
- If you want to override the and you need to extends the Captcha class with your new sub class and override the protected methods of Captcha class for resources directory, and .
-
License
This package is open-sourced software licensed under the MIT license.
All versions of php-simple-captcha with dependencies
lorddashme/php-static-class-interface Version 1.*