Coder Social home page Coder Social logo

tarunk04 / captcha_generator Goto Github PK

View Code? Open in Web Editor NEW
22.0 2.0 3.0 1023 KB

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

License: MIT License

PHP 67.01% JavaScript 20.25% Hack 12.74%
php captcha captcha-generator captcha-image php-captcha captcha-generation php-scripts

captcha_generator's Introduction

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.";
     	}
     ?>

captcha_generator's People

Contributors

tarunk04 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

captcha_generator's Issues

Not working

I have adjusted the script to display just numbers, to aviod any mistake.
I am using Captcha_Generator-master/example.php
When the correct numbers are send back the validation fails. (captcha validation failed.)
but each time an empty sring is send, the validation is accepted (captcha validated.)

So this is not working like it shouldI guess.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.