1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
<?php require_once('recaptchalib.php');
// domain name: global-key.onesolution.com.hk // This is a global key. It will work across all domains. // public key: 6LcVfNcSAAAAADl9pq4_6NeEC-1j4tUZrVOX_A9X // private key: 6LcVfNcSAAAAAAd291tQqQA3dBBH5IV0OaY2tcgh (Use this when communicating between your server and our server. Be sure to keep it a secret.)
$privatekey = "6LcVfNcSAAAAAAd291tQqQA3dBBH5IV0OaY2tcgh"; $resp = recaptcha_check_answer ($privatekey, $_SERVER["REMOTE_ADDR"], $_POST["recaptcha_challenge_field"], $_POST["recaptcha_response_field"]);
if (!$resp->is_valid) { // What happens when the CAPTCHA was entered incorrectly die ("The reCAPTCHA wasn't entered correctly. Go back and try it again." . "(reCAPTCHA said: " . $resp->error . ")"); } else { // Your code here to handle a successful verification echo "true"; } ?>
|