-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdemo_v3.php
More file actions
28 lines (27 loc) · 804 Bytes
/
demo_v3.php
File metadata and controls
28 lines (27 loc) · 804 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<?php
require_once('config.php');
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<title> reCAPTCHA V3 demo </title>
<script src="//code.jquery.com/jquery-1.11.3.min.js"></script>
</head>
<body>
<script src="https://www.google.com/recaptcha/api.js"></script>
<script>
function onSubmit(token) {
$.get("verify_v3.php",{token:token})
.done(function(data){
if(data.success==true){
alert('v3 verify success');
}else{
alert('v3 verify fail errors:' + data.errors);
}
});
}
</script>
<button class="g-recaptcha" data-sitekey="<?=RECAPTCHA_V3_SITE_KEY?>" data-callback='onSubmit' data-action='login'>Submit</button>
</body>
</html>