$recaptcha_secret = 'CLAVE_SECRETA'; $recaptcha_response = $_POST['recaptcha_response']; $url = 'https://www.google.com/recaptcha/api/siteverify'; $data = array( 'secret' => $recaptcha_secret, 'response' => $recaptcha_response, 'remoteip' => $_SERVER['REMOTE_ADDR'] ); $curlConfig = array( CURLOPT_URL => $url, CURLOPT_POST => true, CURLOPT_RETURNTRANSFER => true, CURLOPT_POSTFIELDS => $data ); $ch = curl_init(); curl_setopt_array($ch, $curlConfig); $response = curl_exec($ch); curl_close($ch); $jsonResponse = json_decode($response); if ($jsonResponse->success === true) { // Código para procesar el formulario } else { // Código para aviso de error }