Code Monkey home page Code Monkey logo

recaptcha-vanilla-php's Introduction

YouTube Views Top Lang Forks Stars Issues Pre-Commit License

Google reCAPTCHA V2 Checkbox Server-Side and Client-Side Validation

GIF

The repo includes a complete sample code of how server-side & client-side Google reCATPCHA V2 validations work.

Table of Contents

  1. Installation
  2. Data Attributes
  3. YouTube Tutorials
    1. Server Side Validation
    2. Client Side Validation

Installation

$ git clone https://github.com/Tes3awy/recaptcha-vanilla-php.git
$ cd recaptcha-vanilla-php
$ code . # Only if you are using VSCode

To begin with, you MUST provide both sitekey and secretkey in environment.php file. These keys are provided when you create a reCAPTCHA V2 Checkbox.

It's a best practice approach to add those keys in environment variables as no one should have access to your secretkey.

Data Attributes

data-sitekey="<SITE_KEY>" (Required)
data-theme="<THEME>" (Optional. Allowed values: "light" or "dark". Default: `light`)
data-size="<SIZE>" (Optional. Allowed values: "normal" or "compact". Default: `normal`)
data-callback="<CALLBACK_FUNCTION>" (Optional)
data-expired-callback="<EXPIRY_CALLBACK_FUNCTION>" (Optional)
data-error-callback="<ERROR_CALLBACK_FUNCTION>" (Optional)

I used Bootstrap v5.2.3 as the front-end library. And the zephyr.min.css was downloaded from Bootswatch (Zephyr Theme)


YouTube Tutorials

Server Side Validation

I made a tutorial about the server-side validation on YouTube. Grab your cup of coffee and enjoy ๐Ÿ˜‰

Server Side Validation


Client Side Validation

You can also watch the client-side validation tutorial on YouTube

Client Side Validation


For reference, please visit Google reCAPTCHA Developers Guide.

recaptcha-vanilla-php's People

Contributors

tes3awy avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

dariosalles

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.