├── LICENSE
├── README.md
├── captcha-generator
├── asset
│ ├── main.js
│ └── redo-alt-solid.svg
├── captcha.php
├── fonts
│ ├── 1.ttf
│ ├── 10.ttf
│ ├── 2.ttf
│ ├── 3.ttf
│ ├── 4.ttf
│ ├── 5.ttf
│ ├── 6.ttf
│ ├── 7.ttf
│ ├── 8.ttf
│ └── 9.ttf
└── img_gen.php
├── example.php
├── screenshot
├── img0.png
└── img1.png
└── validate.php
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2020 Tarun Kumar
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | Captcha Generator [](https://github.com/tarunk04/Captcha_Generator/blob/master/LICENSE)
2 | =================
3 |
4 | It is a simple PHP program to generate captcha for form validation. It can be integrated in any website for captcha generation. This project is based on converting text to image using PHP with help of GD. It create 4 character and converts it to image.
5 |
6 | Silent Features
7 | ================
8 | * Each 4 character have different font , random font from the set of 10 fonts.
9 | * Each character has different colour, font size, orientation and position
10 | * Final captcha has many lines with different orientation, size, position and colour.
11 |  
12 |
13 | Installation
14 | ================
15 | * Clone this repository:
16 | ```console
17 | git clone https://github.com/tarunk04/Captcha_Generator
18 | ```
19 | or click `Download ZIP` in right panel of repository and extract it.
20 | * Copy `captcha-generator` folder into the project directory.
21 | * Copy this line to HTML or PHP file of the project.
22 | ```html
23 |
24 | ```
25 | * Copy this script import line at the bottom of the body of same HTML or PHP file.
26 | ```html
27 |
28 | ```
29 | Validating captcha
30 | ===================
31 | * Create a form with a `Text Field` and `Button` to send the user input to server using `POST` method.
32 | * On server side use session variable `$_SESSION['secure']` for validating captch. For example:
33 | ```php
34 |
43 | ```
44 | ---------------------------------------------
45 |
--------------------------------------------------------------------------------
/captcha-generator/asset/main.js:
--------------------------------------------------------------------------------
1 |
2 | document.getElementById('ae_captcha_api').innerHTML = "