NAME="captcha_form"; $form->METHOD="POST"; $form->ACTION=""; $form->debug="error_log"; $error=$form->AddInput(array( "TYPE"=>"custom", "ID"=>"captcha", "LABEL"=>"Enter the following text:", "ACCESSKEY"=>"E", "CustomClass"=>"form_captcha_class", "Key"=>$key, /* "Format"=>"{image} {text} {redraw}{validation}", */ /* "ImageWidth"=>80, */ /* "ImageHeight"=>20, */ /* "TextLength"=>4, */ /* "TextColor"=>"#000000", */ "ImageFormat"=>"png", "NoiseFromPNGImage"=>"noise.png", /* * If you have installed GD with GIF support, you may uncomment these * lines. */ /* "ImageFormat"=>"gif", */ /* "NoiseFromGIFImage"=>"noise.gif", */ "ResetIncorrectText"=>1, "BackgroundColor"=>"#FFFFFF", "ValidationErrorMessage"=>"It was not entered the correct text.", "ExpiryTime"=>60, "ExpiryTimeValidationErrorMessage"=>"The validation text has expired." )); if(strlen($error)) die("Error: ".$error); $form->AddInput(array( "TYPE"=>"submit", "VALUE"=>"Submit", "NAME"=>"doit" )); /* * This code is necessary to handle the requests for serving the captcha * image. * Do not remove it nor output any data or headers before these lines. */ $form->HandleEvent($processed); if($processed) exit; $form->LoadInputValues($form->WasSubmitted("doit")); $verify=array(); if($form->WasSubmitted("doit")) { if(($error_message=$form->Validate($verify))=="") $doit=1; else { $doit=0; $error_message=HtmlEntities($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 CAPTCHA plug-in input

Test for Manuel Lemos' PHP form class using the CAPTCHA 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(); } ?>