2010-01-27 45 views

回答

2

爲了使用reCAPTCHA,您需要a public/private API key pair

使用PHP Library,顯示驗證碼:

require_once('recaptchalib.php'); 
$publickey = "..."; // you got this from the signup page 
echo recaptcha_get_html($publickey); 

,然後驗證:

require_once('recaptchalib.php'); 
$privatekey = "..."; 
$resp = recaptcha_check_answer ($privatekey, 
           $_SERVER["REMOTE_ADDR"], 
           $_POST["recaptcha_challenge_field"], 
           $_POST["recaptcha_response_field"]); 
+0

喜歡走給我回錯誤消息,並再次嘗試(驗證碼說:invalid-站點私鑰) – pratik 2012-10-18 06:02:44