Come fare ad usare il reCaptcha senza uso delle librerie???

Donovant

Utente Attivo
24 Giu 2010
49
0
0
La guida dice:

"This page explains how to verify a user's answer for a reCAPTCHA challenge without using a plugin. We offer a variety of plugins for different applications and programming environments, such as PHP and ASP.NET, and we encourage you to look at our multiple plugins before proceeding with the "Do-It-Yourself" (DIY) installation instructions below."

E poi

After your page is successfully displaying reCAPTCHA, you need to configure your form to check whether the answers entered by the users are correct. This is achieved by doing a POST request to http://www.google.com/recaptcha/api/verify. Below are the relevant parameters.

API Request

URL: http://www.google.com/recaptcha/api/verify

Parameters (sent via POST)
privatekey (required) Your private key
remoteip (required) The IP address of the user who solved the CAPTCHA.
challenge (required) The value of "recaptcha_challenge_field" sent via the form
response (required) The value of "recaptcha_response_field" sent via the form

Grazie
 
Mi hanno consigliato di usare cURL (api PHP) per ottenere le info dal link, dato dalla guida di google, richiesto.
Ma ancora non ho capito come usarle:

$ch = curl_init("http://www.google.com/recaptcha/api/verify");


curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HEADER, 0);

$response = curl_exec($ch);
$info = curl_getinfo($ch, CURLINFO_HTTP_CODE);

curl_close($ch);
echo $response."<br/>";
echo $info."<br/>";

In locale, la pagina in questione carica all'infinito
Online invece esce fuori il logo di Google con il seguente testo:
Error 400. That’s an error.
Your client has issued a malformed or illegal request. That’s all we know. 1
 

Discussioni simili