Giter Site home page Giter Site logo

PHP ArCaptcha Library

Latest Stable Version Total Downloads Latest Unstable Version License PHP Version Require

PHP library for ArCaptcha. This package supports PHP 7.3+.

List of contents

Installation

Require this package with composer:

composer require arcaptcha/arcaptcha-php

Configuration

You can create a new instance by passing the SiteKey and SecretKey from your API. You can get that at https://arcaptcha.ir/dashboard

use Mohammadv184\ArCaptcha\ArCaptcha;

$ArCaptcha = new ArCaptcha($siteKey, $secretKey);

// To set options like color,lang,...
$ArCaptcha = new ArCaptcha($siteKey, $secretKey,['lang'=>'en','theme'=>'dark']);

To see available options on widget see here

How to use

How to use ArCaptcha.

Widget usage

To show the ArCaptcha on a form, use the class to render the script tag and the widget.

<?php echo $ArCaptcha->getScript() ?>
<form method="POST">
    <?php echo $ArCaptcha->getWidget() ?>
    <input type="submit" value="Submit" />
</form>

Note: You can pass available widget options like color,lang,... into getWidget function

Verifying a response

After the post, use the class to verify the response. You get true or false back:

if ($ArCaptcha->verify($_POST["arcaptcha-response"])) {
    echo "OK!";
} else {
    echo "FAILED!";
}

Invisible mode

To see how invisible mode is working in this library see this example

Credits

License

The MIT License (MIT). Please see License File for more information.

Arcaptcha's Projects

arcaptcha-go icon arcaptcha-go

Arcaptcha library implementation in Golang to validate captcha.

arcaptcha.csharp icon arcaptcha.csharp

One of the most well-documented Arcaptcha libraries in the open source community

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.