Note that there are some explanatory texts on larger screens.

plurals
  1. POrecaptcha always returns false
    primarykey
    data
    text
    <p>Im having a issue with my recaptcha. The problem is that it always returns false meaning it says the captcha failed. even when the right word is typed in.</p> <p>Everything is up to date, using the latest library and triple checked the code and public/private key. </p> <p>Issue I believe lies here....</p> <pre><code>require_once('recaptchalib.php'); $privatekey = "************************************"; $resp = recaptcha_check_answer ($privatekey, $_SERVER["REMOTE_ADDR"], $_POST["recaptcha_challenge_field"], $_POST["recaptcha_response_field"]); if (!$resp-&gt;is_valid) { $error_string .= '&lt;center&gt;The reCAPTCHA wasnt entered correctly. Go back and try it again.&lt;/center&gt;&lt;br /&gt;'; } </code></pre> <p>I followed this example so I can't see what is going wrong. Been at it for days!</p> <p><a href="https://developers.google.com/recaptcha/docs/php" rel="nofollow">https://developers.google.com/recaptcha/docs/php</a></p> <p>CLient Code:</p> <pre><code>require_once('recaptchalib.php'); $publickey = "**********************"; // you got this from the signup page echo recaptcha_get_html($publickey); </code></pre> <p>carried out a var dump on the $resp variable and got this</p> <pre><code>object(ReCaptchaResponse)#2 (2) { ["is_valid"]=&gt; bool(false) ["error"]=&gt; string(21) "incorrect-captcha-sol" } </code></pre> <p>also did a <code>var_dump</code> recaptcha response field and got:</p> <pre><code>NULL </code></pre> <p>var dump post...</p> <pre><code>array(7) { ["user"]=&gt; string(0) "" ["pass1"]=&gt; string(0) "" ["pass2"]=&gt; string(0) "" ["email"]=&gt; string(0) "" ["email2"]=&gt; string(0) "" ["gender"]=&gt; string(4) "Male" ["register"]=&gt; string(8) "register" } </code></pre> <p>var dump request...</p> <pre><code>array(10) { ["user"]=&gt; string(0) "" ["pass1"]=&gt; string(0) "" ["pass2"]=&gt; string(0) "" ["email"]=&gt; string(0) "" ["email2"]=&gt; string(0) "" ["gender"]=&gt; string(4) "Male" ["register"]=&gt; string(8) "register" ["PHPSESSID"]=&gt; string(26) "4e79u2fdgrrufvb79einufcmq6" ["cprelogin"]=&gt; string(2) "no" ["cpsession"]=&gt; string(65) ":fX5Z1aWfbsgjGfgb3b3J7koo3Y58y5ntgM6k8GTdrQ4YAcqaywAKnD7PRiayfXv3" } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload