編輯過的實際密鑰「我正在用REcaptcha實現一個簡單的登錄表單 REcaptcha給了我這個錯誤: 」reCAPTCHA輸入不正確。回去再試試。(reCAPTCHA的說:不正確,驗證碼-SOL)」 這是我的代碼:Recaptcha「incorrect-captcha-sol」
的index.php
<table width="300" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
<tr>
<form name="form1" method="post" action="verify.php">
<td>
<table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF">
<tr>
<td colspan="3"><strong>Member Login </strong></td>
</tr>
<tr>
<td width="78">Username</td>
<td width="6">:</td>
<td width="294"><input name="myusername" type="text" id="myusername"></td>
</tr>
<tr>
<td>Password</td>
<td>:</td>
<td><input name="mypassword" type="text" id="mypassword"></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td><input type="submit" name="Submit" value="Login"></td>
</tr>
</table>
</td>
</form>
</tr>
</table>
<html>
<title>Title Dolan Webiste</title>
<body>
<script type="text/javascript"
src="http://www.google.com/recaptcha/api/challenge?k=actual_key_redacted">
</script>
<noscript>
<iframe src="http://www.google.com/recaptcha/api/noscript?k=actual_key_redacted"
height="300" width="500" frameborder="0"></iframe><br>
<textarea name="recaptcha_challenge_field" rows="3" cols="40">
</textarea>
<input type="hidden" name="recaptcha_response_field"
value="manual_challenge">
</noscript>
</body>
</html>
Verify.php
<?php
echo "<pre> _POST: =========\n";
print_r($_POST);
echo "\n=========\n</pre>";
?>
<?php
require_once('recaptchalib.php');
$privatekey = "private_key_here";
$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
}
?>
我有不知道我做錯了什麼 任何幫助?
ps是的我在同一個目錄中有recaptchalib.php。
你表明你進入你的公鑰在HTML,但你是不是表示你進入你的私人關鍵在PHP中。你是否? – Sparky
我做過了,我試圖隱藏自己的私鑰(可能會被濫用) – none
我很確定我輸入了正確的密碼,我複製粘貼它。 – none