Tag Archives: captcha

add_captcha()

add_captcha() : $this

Add CAPTCHA* (“Completely Automated Public Turing test to tell Computers and Humans Apart”), a type of challenge-response test used in computing to determine whether or not the user is human.

* phpDatabaseForm uses realperson jQuery plugin available under MIT license.

Are You Human? Add CAPTCHA!

PHP Database Form has a built-in CAPTCHA (“Completely Automated Public Turing test to tell Computers and Humans Apart”), a type of challenge-response test used in computing to determine whether or not the user is human. Simply call add_captcha() method to add a CAPTCHA to the end of the form. No programming is required.

captcha control

$dbForm = new C_DatabaseForm("SELECT * FROM Employees", "EmployeeID", "Employees");
$dbForm -> set_label("EmployeeID", "Employee ID");
$dbForm -> set_label("LastName", "Last Name");
$dbForm -> set_label("FirstName", "First Name");
$dbForm -> set_label("BirthDay", "DOB");
$dbForm -> set_hide("Extension");
$dbForm -> set_hide("hireDate");
$dbForm -> set_placeholder('Title', 'official job title');
$dbForm -> add_group_header("EmployeeID", "Basic Info");
$dbForm -> add_group_header("Email", "Contact Info");
$dbForm -> add_tooltip("BirthDate", "Enter employee birth date"); // tooltip supports HTML as well
$dbForm -> set_readonly(array('EmployeeID, LastName'));
$dbForm -> set_ctrltype('Notes', 'wysiwyg');
$dbForm -> set_ctrltype("Country", "autocomplete", "SELECT Code, Name FROM Country");
$dbForm -> set_ctrltype("ReportsTo", "select", "SELECT EmployeeID, LastName FROM Employees");
$dbForm -> set_ctrltype('Email', 'email');
$dbForm -> set_ctrltype('Gender', 'radio', 'M:MMM;F:FFF;Y:YYY;Z:ZZZ');
$dbForm -> set_ctrltype('IsActive', 'checkbox', '1:0');  // single key value pair only
$dbForm -> set_ctrltype('Shift', 'checkboxlist', 'Regular:Regular;Gravy Yard:Gravy Yard');
$dbForm -> set_ctrltype('SSN', 'password');
$dbForm -> set_editrule("SSN", "SSN_validate"); // validate format with javascript
$dbForm -> set_maxlength("LastName", 8);
$dbForm -> set_default('Title', 'N/A');
$dbForm -> set_form_dimension(800, 1200);  // set width and height for entire form
$dbForm -> add_captcha(); // ARE YOU HUMAN?
$dbForm -> display();

Live demo