title: How to validate Google reCAPTCHA v3 on server side?
body: <p>I've just set up the new google recaptcha with checkbox, it's working fine on front end, however I don't know how to handle it on server side using PHP. I've tried to use the old code below but the form is sent even if the captcha is not valid.</p>
  
  <pre><code>require_once('recaptchalib.php');
  $privatekey = "my key";
  $resp = recaptcha_check_answer ($privatekey,
          $_SERVER["REMOTE_ADDR"],
          $_POST["recaptcha_challenge_field"],
          $_POST["recaptcha_response_field"]);
  
  if (!$resp-&gt;is_valid) {
   $errCapt='&lt;p style="color:#D6012C "&gt;The CAPTCHA Code wasnot entered correctly.&lt;/p&gt;';}
  </code></pre>