コード例 #1
0
function verifyReCaptcha()
{
    $url = "https://www.google.com/recaptcha/api/siteverify";
    $params = array('secret' => GOOGLE_RECAPTCHA_SECRET, 'response' => isset($_POST['g-recaptcha-response']) ? $_POST['g-recaptcha-response'] : NULL, 'remoteip' => $_SERVER['REMOTE_ADDR']);
    $response = RC::http_post($url, $params);
    //logIt("ReCaptuca Result " . print_r($response,true) . " from " . print_r($params,true), "DEBUG");
    return json_decode($response, true);
}