Create index.html
Browse files- index.html +37 -0
index.html
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="en">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<title>hCaptcha Test</title>
|
| 6 |
+
<script src="https://hcaptcha.com/1/api.js" async defer></script>
|
| 7 |
+
</head>
|
| 8 |
+
<body style="font-family:sans-serif; text-align:center; margin-top:50px;">
|
| 9 |
+
|
| 10 |
+
<h2>🔒 hCaptcha Demo (Flat Structure)</h2>
|
| 11 |
+
|
| 12 |
+
<div class="h-captcha"
|
| 13 |
+
data-sitekey="YOUR_SITEKEY_HERE"
|
| 14 |
+
data-callback="sendToken"></div>
|
| 15 |
+
|
| 16 |
+
<h3>Result:</h3>
|
| 17 |
+
<pre id="result" style="border:1px solid #ccc; padding:10px; width:80%; margin:auto; background:#f9f9f9;"></pre>
|
| 18 |
+
|
| 19 |
+
<script>
|
| 20 |
+
async function sendToken(token) {
|
| 21 |
+
console.log("hCaptcha Token:", token);
|
| 22 |
+
|
| 23 |
+
let formData = new FormData();
|
| 24 |
+
formData.append("token", token);
|
| 25 |
+
|
| 26 |
+
let response = await fetch("/verify", {
|
| 27 |
+
method: "POST",
|
| 28 |
+
body: formData
|
| 29 |
+
});
|
| 30 |
+
|
| 31 |
+
let result = await response.json();
|
| 32 |
+
document.getElementById("result").textContent = JSON.stringify(result, null, 2);
|
| 33 |
+
}
|
| 34 |
+
</script>
|
| 35 |
+
|
| 36 |
+
</body>
|
| 37 |
+
</html>
|