Файл: demos/verificate.php
Строк: 47
<?php
/**************************************************************************************************
|
| http://alternanetworks.com
| ask@alternanetworks.com
|
|**************************************************************************************************
|
| By using this software you agree that you have read and acknowledged our End-User License
| Agreement available at http://envato.com/ and to be bound by it.
|
| Copyright (c) 2011 alternanetworks.com All rights reserved.
|
| http://codecanyon.net/user/AlternaNetworks
|**************************************************************************************************/
//error_reporting( E_ALL );
//ini_set( 'display_errors', '1' );
// load system
require_once ( "../captcha/load.php" );
// initialize myCaptcha
$captcha = new myCaptcha();
// catch the captcha from POST
$challenge = isset( $_POST['challenge'] ) ? $_POST['challenge'] : false;
// set headers to server json
header('Content-type: application/json');
// same captcha id
$serverChallenge = $captcha->challenge('standalone_demo');
// check for bot
if($serverChallenge == $challenge){
// not bot
$response = true;
} else {
// is a bot
$response = false;
}
// print ajax response
echo json_encode($response);