Skip to content

Instantly share code, notes, and snippets.

View cohan's full-sized avatar
💭
Tinkering

Cohan cohan

💭
Tinkering
View GitHub Profile
<?php
$captchaVerification = !empty($_REQUEST["captcha_verification"]) ? $_REQUEST["captcha_verification"] : false;
if ($captchaVerification !== false) {
$data = [
"endpoint" => "verify",
"captcha_verification" => $captchaVerification,
"captcha_difficulty" => 5 // make sure the difficulty matches the diffulty you added to form button
];
$options = [
"http" => [
<!DOCTYPE html>
<html>
<head></head>
<body>
<form action="https://link.to.your.form/" id="wehatecaptchas">
<!— more inputs here —>
<button type="submit" difficulty="5">Submit</button>
</form>
<script>
const onSubmit = (data) => {