is_valid) {
$_SESSION['contactform']['passedimage'] = true;
return true;
}
return false;
}
require_once($_SERVER['DOCUMENT_ROOT']."/tutorials/formprocessor/contact/recaptchalib.php");//Include the recaptcha class
$javascript = <<
var RecaptchaOptions = {
theme: 'custom',
lang: 'en',
custom_theme_widget: 'recaptcha_widget'
};
EOD;
$public = "6LcVYgQAAAAAABG5IOef21_v3tuhZXGRKEg-WXdP"; //Public Key for recaptcha
$private = "6LcVYgQAAAAAAJFjVVeejrCHaugQ0pT5dT10IvsV";//Private key for recaptcha
$error = null; //No Errors as of yet
$recaptchahtml = recaptcha_get_html($public, $error);//Get the recaptcha HTML
echo $javascript;//Display the recaptcha Javascript
function contactForm() {// This function contains all the form markup and HTML
global $config, $recaptchahtml;
$form = <<
!
!
!
!
Incorrect please try again
Enter the words above:Enter the numbers you hear:!
{$recaptchahtml}
EOD;
return $form;
}
try {
$processor =& new FormProcessor(contactForm());
if(isset($_POST["submitForm"])) {
if(((time() - $_SESSION['contactform']['time'])>15)){
if ($processor->validate()) {
echo 'The Form Was Submitted, Wahey! Here is the $_POST data';
echo '