NAME = 'captcha_form';
$form->METHOD = 'GET';
$form->ACTION = '';
$form->debug = 'error_log';
$error = $form->AddInput(array(
'TYPE'=>'custom',
'ID'=>'captcha',
'LABEL'=>'Enter the following text:',
'ACCESSKEY'=>'E',
'CustomClass'=>'form_recaptcha_class',
'Key'=>$key,
'PrivateKey'=>$private_key,
// 'ValidationErrorMessage'=>'It was not entered the correct text.',
// 'DependentValidation'=>'',
// 'InputClass'=>'',
// 'InputStyle'=>'',
// 'InputTabIndex'=>10,
// 'InputExtraAttributes'=>array(),
/* 'Format'=>'
{image}
{instructions_visual}{instructions_audio} {input}
{refresh_btn} {visual_challenge}{audio_challenge} {help_btn}
',*/
/* 'Text'=>array(
'instructions_visual'=>'Enter the words above',
'instructions_audio'=>'Enter the numbers you hear',
'visual_challenge'=>'Enter text in an image instead',
'audio_challenge'=>'Enter numbers you hear instead',
'refresh_btn'=>'Try another',
'help_btn'=>'Help',
'play_again'=>'Play the sound again',
'cant_hear_this'=>'Download the sound as a MP3 file',
'image_alt_text'=>'Image with text to enter'
) */
));
if(strlen($error))
die('Error: '.$error);
$form->AddInput(array(
'TYPE'=>'submit',
'VALUE'=>'Submit',
'NAME'=>'doit'
));
/*
* Always check if LoadInputValues returns any errors to detect any
* configuration or reCAPTCHA access problem
*/
if(strlen($error = $form->LoadInputValues($form->WasSubmitted('doit'))))
die('Error processing reCAPTCHA response: '.$error);
$verify = array();
if($form->WasSubmitted('doit'))
{
if(($error_message = $form->Validate($verify))=='')
$doit = 1;
else
{
$doit = 0;
$error_message = HtmlSpecialChars($error_message);
}
}
else
{
$error_message = '';
$doit = 0;
}
if(!$doit)
$form->ConnectFormToInput('captcha', 'ONLOAD', 'Focus', array());
$onload = HtmlSpecialChars($form->PageLoad());
?>
Test for Manuel Lemos' PHP form class using the reCAPTCHA plug-in input
Test for Manuel Lemos' PHP form class using the reCAPTCHA plug-in input
The entered text GetInputValue('captcha'); ?> is correct.
StartLayoutCapture();
$title = 'Form CAPTCHA plug-in test';
$body_template = 'form_captcha_body.html.php';
include('templates/form_frame.html.php');
$form->EndLayoutCapture();
$form->DisplayOutput();
}
?>