$recaptcha = htmlspecialchars($_POST["g-recaptcha-response"],ENT_QUOTES,'UTF-8'); if(isset($recaptcha)){ $captcha = $recaptcha; }else{ $captcha = ""; echo "captchaエラー"; exit; } $secretKey = "6Lcihd4fAAAAAEVm4QbFb5mex2aU3E2P5z_bmdig"; $resp = @file_get_contents("https://www.google.com/recaptcha/api/siteverify?secret={$secretKey}&response={$captcha}"); $resp_result = json_decode($resp,true); if(intval($resp_result["success"]) !== 1) { //認証失敗時の処理をここに書く }else{ //認証成功時の処理をここに書く //ここにmailsend等の記述をする。 } ?>
「名前」が未選択です。
「Email」が未選択です。
「お問い合わせ内容」が未選択です。
「TEL」が未選択です。
「syurui」が未選択です。