'Submit button not checking for hCaptcha verification
Im making this website that makes you keep doing captchas forever, but I cant seem to get the button to only work when the captcha has been done, I've tried everything I know how to and I still cant figure out how (if the solve is very easy i apologize im dumb)
below is the code
<html>
<head>
<title>Waste-time</title>
<script src="https://js.hcaptcha.com/1/api.js" async defer></script>
</head>
<body>
<form action="" method="POST">
<h1>Waste time</h1>
<div class="h-captcha" data-sitekey="3b3e860d-4d9f-4149-84f4-b19e2c4af546"></div>
<br/>
<input onClick="one();" type="Submit" value="Again" />
</form>
<script>
function one()
if (success = 'true') {
history.go(0);
}
else {
alert('Do ur captcha cheater');
}
</script>
<script>
SECRET_KEY = "XXXXXX (I know what to put here) " # replace with your secret key
VERIFY_URL = "https://hcaptcha.com/siteverify"
# Retrieve token from post data with key 'h-captcha-response'.
token = request.POST_DATA['h-captcha-response']
# Build payload with secret key and token.
data = { 'secret': SECRET_KEY, 'response': token }
# Make POST request with data payload to hCaptcha API endpoint.
response = http.post(url=VERIFY_URL, data=data)
# Parse JSON from response. Check for success or error codes.
response_json = JSON.parse(response.content)
success = response_json['success']
</script>
<table height="10" style="border-collapse: collapse; width: 75%;" border="1">
<tbody>
<tr>
<td height="10" style="width: 33.3333%;">
<h2>Everyone combined has done</h2>
</td>
<td height="10" style="width: 33.3333%;"> <a
href='https://dissertation-writingservice.com/'>Loading...</a> <script type='text/javascript' src='https://www.freevisitorcounters.com/auth.php?id=2c7bc93845d15dbac3123dd9c611d9d4ee36465f'></script>
<script type="text/javascript" src="https://www.freevisitorcounters.com/en/home/counter/917627/t/3"></script></td>
<td height="10" style="width: 33.3333%;">
<h2>Captchas</h2>
</td>
</tr>
</tbody>
</table>
</body>
</html>
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
