Skip to content

It is a simple PHP script to generate captcha for form validation. It can be integrated in any website for captcha generation.

License

Notifications You must be signed in to change notification settings

tarunk04/Captcha_Generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Captcha Generator license

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.

Silent Features

  • Each 4 character have different font , random font from the set of 10 fonts.
  • Each character has different colour, font size, orientation and position
  • Final captcha has many lines with different orientation, size, position and colour.
    g g

Installation

  • Clone this repository:
     git clone https://github.com/tarunk04/Captcha_Generator
    or click Download ZIP in right panel of repository and extract it.
  • Copy captcha-generator folder into the project directory.
  • Copy this line to HTML or PHP file of the project.
     <div id="ae_captcha_api"></div>
  • Copy this script import line at the bottom of the body of same HTML or PHP file.
     <script src="./captcha-generator/asset/main.js"></script>

Validating captcha

  • Create a form with a Text Field and Button to send the user input to server using POST method.
  • On server side use session variable $_SESSION['secure'] for validating captch. For example:
     <?php 
     	session_start();
     	if($_SESSION['secure'] == $_POST['user_input']){
     	  echo "captcha validated.";
     	} 
     	else{
     	  echo "captcha validation failed.";
     	}
     ?>

About

It is a simple PHP script to generate captcha for form validation. It can be integrated in any website for captcha generation.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published