PHP Classes

File: examples/nocaptcha-captcha.php

Recommend this page to a friend!
  Classes of sameer shelavale  >  PHP Multi CAPTCHA  >  examples/nocaptcha-captcha.php  >  Download  
File: examples/nocaptcha-captcha.php
Role: Example script
Content type: text/plain
Description: Example script
Class: PHP Multi CAPTCHA
Perform CAPTCHA validation with multiple solutions
Author: By
Last change: fixed the include filename in examples.
Date: 6 years ago
Size: 941 bytes


Class file image Download

include_once( "../src/Captcha.php");
"../vendor/autoload.php");//not required if you have PSR-4 autoloader

$captcha = new \MultiCaptcha\Captcha([
'secret'=> "form1-secret-key",
'options' => [
'nocaptcha' => [
'siteKey'=> "6LfObQkTAAAAADPFtykBvYkNegv2lkGjThGxEvqC", // replace this with your site key
'secretKey' => "6LfObQkTAAAAADnUOa3Ry5H_6_Iymt-8-RFDQGdH" // replace this with your secret key
] );

if( isset(
$_REQUEST['submit'] ) ){
$captcha->validate( $_POST, $_SERVER['REMOTE_ADDR'] ) ) {
"Wrong: ". $captcha->error;

<form action="" method="post">
echo $captcha->render() ;
<input type="submit" name="submit" value="Submit">


For more information send a message to info at phpclasses dot org.