PHP code example of lefuturiste / recaptcha_poo

1. Go to this page and download the library: Download lefuturiste/recaptcha_poo library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

lefuturiste / recaptcha_poo example snippets


  
  $captcha = new recaptcha('YOUR PUBLIC KEY GOOGLE API', 'YOUR SECRET KEY GOOGLE API');
  

  
  if (empty($_POST['g-recaptcha-response'])){
    //error
  }
  else{
    //continue script
  }
  

  
  if ($captcha->isSuccess($_POST['g-recaptcha-response']) == false) {
	  //error
  } else { 
    //successs
  }
  

  $dataTheme = 'light';
  //$dataTheme = 'dark';
  <?= $captcha->getHtml($dataTheme)