PHP Form Builder is a complete library based on a PHP class. It allows you to program and layout all types of PHP/HTML forms using the Drag & Drop Form Builder or the built-in PHP functions.
PHP Form Builder is conceived for use with the most popular frameworks: Bootstrap 4, Bootstrap 5, Bulma, Foundation, Material Design, Tailwind CSS, and UIKit.
If you use another framework, the configuration options will allow you to generate the appropriate HTML code.
Creating forms is a complex and tedious task, even more so if you care about the user experience. Below is a summary of how PHP Form Builder can help you.
PHP Form Builder:
Creates your forms by drag & drop or using the built-in PHP functions
Generates the HTML code of your forms according to the chosen framework
Allows you to improve your forms with the help of the best JavaScript plugins available
Dramatically simplifies the integration of JavaScript plugins
Validates user inputs in real-time
Validates user inputs on the server-side
Handles the security of your forms (XSS/CSRF protection, Anti-spam)
Allows you to send the posted data by email
Allows you to save the posted data in your database
Generates compiled minified CSS & JavaScript files for ultra-fast loading
Creates any type of form: Step forms, Accordion forms, Ajax loading, Modal, Popover, ...
Documentation is well-adapted for all types of users: PHP beginners as well as confirmed programmers.
Is PHP Form Builder suitable for you?
PHP Form Builder is perfect for creating all types of forms in any situation:
Each template is provided with the PHP source code.
Code includes Live & Server-side Validation and Email sending
Email Sending
Built-in function to send posted values easily.
Support for attachments and Custom Email templates.
Send emails in HTML or plain text format.
Powerful plugins integration
Don't waste your time including CSS & JS files and writing your JS code.
PHP Form Builder will easily add any JavaScript plugin and do all this job for you.
30+ JavaScript plugins included
Best JavaScript Form plugin included in the package and ready to use to enhance your forms with file uploader, custom radio, checkboxes, select, pickers (date, time, color), captcha, ...
Maximum Security
Automatic XSS and CSRF protection - maximum level security.
Built-in Anti-Spam filter.
Server-side validation
Validate any field with any condition.
Your page will automatically scroll to user error if fields are not filled correctly.
Conditional logic
Show / Hide fields depending on the user's choices
One easy function for all logic. Conditional fields can be nested.
Special forms
Ajax forms, Step forms, Modal forms, Popover forms, and Accordion forms: Simple and easy integration with templates and complete documentation.
Professional Support
We care for each customer and do our best to give efficient help.
mailerThe email templates and a test file to test email sending on your server.
pluginsAll the plugins. You don't need to upload on your server the plugins you don't use in your forms.
plugins-configAll the plugins' configuration files ("domready" codes stored into XML files). You don't need to upload on your server the plugins you don't use in your forms.
plugins-config-customEmpty folder to store your plugin configurations files if you customize.
vendorThe vendor packages used by PHP Form Builder. E.g.: PowerLite PDO, PHP-DI, PHPMailer.
register.phpRegister & activate your PHP Form Builder copy from here.
server.phpFile used for debugging purposes if you encounter paths issues on your server.
Features
Form generation with complex layout capabilities (horizontal, vertical, inline)
PHP Form Builder generates clean HTML5 markup, with separates functions to render form, generate CSS and JS code, so you can render them separately (generally in <head> or just before </body>).
Creates Bootstrap 4 Forms, Bootstrap 5 Forms, Bulma Forms, Foundation Forms, Material Design Forms, Tailwind Forms, uiKit Forms.
Compatible with any framework or can be used standalone.
Accepts any HTML5 form elements, including fieldsets, multiple selects, optgroups, button groups, ...
Allows customizing HTML with wrappers, IDs, classes and attributes, JavaScript events, custom code anywhere.
Server-side validation can be done on any destination page; errors are stored in the PHP session.
Sends your emails with a simple or advanced function.
Detects and replaces posted values in default or custom HTML/CSS template. Uses PHPMailer and Emogrifier to inline CSS.
Uses PHPMailer with or without SMTP and Emogrifier to inline CSS.
XSS / CSRF Protection
PDO Database library included to prefill fields with values from your database easily, Create/Read/Update/Delete elements using the posted values (CRUD operations).
Memorization/recall of any custom configuration for each plugin
You can easily add any other external plugin (see plugins section).
PHP Form Builder automatically adds the needed CSS and JS files to your page when you activate a plugin.
$form = new Form('my-form', 'horizontal', 'novalidate', 'tailwind');
UIKit
$form = new Form('my-form', 'horizontal', 'novalidate', 'uikit');
No framework
Add the minimal Bootstrap 5 CSS to your page head, then you can build your forms with Bootstrap 5.
This style sheet only includes what is necessary to layout your responsive forms and will not break anything in the other parts of your pages.
<head>
// link to the minimal Bootstrap 5 CSS
<link rel="stylesheet" href="/phpformbuilder/templates/assets/bootstrap5-phpfb/css/bootstrap5-phpfb.min.css">
</head>
<?php
// Then you can build your form
$form = new Form('my-form', 'horizontal', 'novalidate');
Bug Fix:
- fix the PHP validator's 'required' validation when the fields are not posted
- fix the file uploader code generated by the drag & drop form builder
- fix the image uploader's editor to save files & thumbnails after editing
- fix the checkbox columns width in the drag & drop form builder
- fix php typings in the drag & drop form builder for php 7.4
version 6.0.4 (07/2024)
Improvements:
- disable the floating labels in the date input fields
Bug Fix:
- fix email sending with BCC
- fix a cross-browser bug with the floating-labels plugin
- fix the plugins URL detection with symlinks
- fix php 'required' validation on empty strings
- fix a type error in validator::hasPattern()
version 6.0.3 (06/2024)
Bug Fix:
- fix missing input placeholders in the drag & drop form builder
version 6.0.2 (05/2024)
Bug Fix:
- fix PHP composer error with PHP < 8.2
- fix types error with php < 8.0
- fix floating labels position in Modal forms
- disable the floating labels in tinymce textareas
version 6.0.1 (05/2024)
Bug Fix:
- fix the plugins path & URL when the form builder is in a subfolder
- fix the addCountry method when there's multiple country fields on the same page.
version 6.0 (05/2024)
Breaking changes:
- PHP Form Builder now uses a global autoloader for the Form Builder's classes, the mailer, the database and pagination classes
New Features:
- add the Altcha plugin with Anti-SPAM features - https://www.phpformbuilder.pro/documentation/javascript-plugins.php#recaptchav3-example
- add the Floating Labels plugin - https://www.phpformbuilder.pro/documentation/javascript-plugins.php#floating-labels
- add the "addError($field, $message)" function to the Validator
Improvements:
- redesign the drag & drop form builder with code refactoring and performance improvements
- add a global autoloader for the Form Builder's classes, the mailer, the database and pagination classes
- improve robustness, code quality and reliability with PHPSTAN's highest standards (level 8)
- move the Database & pagination classes to the "vendor" folder and use the Github public package (https://github.com/migliori/power-lite-pdo)
- add the "getIncludes($debug = false)" function to get the list of all the plugins dependencies (JS & CSS)
- add the "getJsCode($debug = false)" function to get the Javascript code of the activated plugins
- change the naming convention of the php variables from snake_case to smallCamelCase
- move the bottom margins in Bootstrap forms from rows to columns
Bug Fix:
- fix a bug with the file uploader with multiple instances and required files
- fix a type error in the file uploader with php 8.3+
- fix Tinymce's filemanager bug with PHP ^8.0
- fix drag & drop form builder's input patterns for Chrome - https://github.com/GoogleChrome/chromium-dashboard/issues/3106
version 5.3 (01/2024)
New Features:
- add the code for Recaptcha to be properly loaded in Ajax forms
Improvements:
- add php type hinting and enable PHP strict_types
- fix PHP 8.3 deprecation warnings
- review PHP Standard compliance with PHPCS and PHPCBS - Standard:PHPCompatibility 7.4-8.3
- add SQL group_by clause in DB->select() '$extras' argument
- update the Signature Pad plugin to the latest version (v4.1.6)
- add the 'data-height' attribute to the Signature Pad input
Bug Fix:
- repair the database getLastInsertId() function
- fix "update" queries using the same fieldname in both values and where clause
- fix Deprecated error in class.fileuploader.php
version 5.2.1 (01/2023)
New Features:
- Support of different RDBMS with PDO drivers (MySQL/MariaDB, Oracle, PostgreSQL, Firebird)
- add new functions to the database PDO wrapper: https://www.phpformbuilder.pro/documentation/php-pdo-database-class.php
Improvements:
- Improve Dependent fields events management & performance
- handle required fields validation inside nested dependent fields
Bug Fix:
- The events on inputs with the Pretty checkbox plugin enabled will now work as expected
- update the Passfield plugin to solve a Popover bug with the latest Bootstrap
- memorization of the 'inline' checkbox/radio value in the drag & drop form builder
version 5.2 (10/2022)
New Features:
- add new functions to the database PDO wrapper: https://www.phpformbuilder.pro/documentation/php-pdo-database-class.php
- add the "limit" argument to the "select" function of the database PDO wrapper
- add the getOptions() function to show the list of the current options (or single/multiple options values)
Improvements:
- add the "utf-8" charset in the DB connection settings
- upgrade the Slimselect plugin to the latest version v1.27.1
Bug Fix:
- Dependent fields will not be posted anymore when they're hidden
- fix the broken links in the index.html if the Codecanyon package
version 5.1 (07/2022)
New Features:
- add ability to copy (duplicate) fields in the Drag and Drop form builder
Improvements:
- add max-height + vertical scrollbars to the Drag and Drop form builder
- disable the hcaptcha's recaptcha compat option
- update the template's ajax-loaded-multiple-forms
- update the Select2 plugin to its latest version 4.1.0-rc.0
Bug Fix:
- edit the intltelinput Javascript to set the full phone value in real time (was buggy since the last plugin upgrade)
- fix formValidation plugin not revalidating after removing file with fileuploader when upload limit is set to 1
version 5.0.6 (03/2022)
New Features:
- ability to center the HCaptchas with the Drag & Drop
Improvements:
- add a "no action" option in the drag & drop for the form action after validation
- add a regexp and helper text to validate the components names entered by the user in the Drag & Drop
Bug Fix:
- fix use of array_key_last with php < 7.3
- fix formvalidation code for Tinymce required fields
- remove Tinymce from the compiled Javascript to avoid 404 errors on Tinymce dependencies
version 5.0.5 (03/2022)
Improvements:
- show the warning message on file uploader failure
- add a warning message in the drag & drop on database update if no field has been specified in the WHERE clause
- show the HTML code in the drag & drop HTML components
- add "copy" buttons to all the code blocks in drag & drop and documentation
Bug Fix:
- fix paths of the file uploader email attachments generated by the drag & drop form builder
- fix and improve the plugins loading system after POST with Ajax
- fix the database insert code generated by the drag & drop
- fix the database update code generated by the drag & drop
- fix script loading & triggering issues with Ajax
version 5.0.4 (03/2022)
Improvements:
- Improve the drag & drop layout
Bug Fix:
- fix the File uploader code with drag & drop and Ajax
version 5.0.3 (03/2022)
Improvements:
- add instructions for CMS users in the Quickstart Guide
- remove Typography CSS from the custom minimal Bootstrap 5 CSS version (templates/assets/bootstrap5-phpfb)
- replace the jQuery code generated by the Drag & drop form builder with a clean Vanilla JavaScript code
Bug Fix:
- replace a stupid white text on white background in the drag & drop form code modal
- edit the LCSwitch plugin to make it work with inputs inside labels
- add the Materialize base JavaScript, which was missing when loading forms with Ajax
version 5.0.2 (03/2022)
Bug Fix:
- solve a bug with the file uploader & images
version 5.0.1 (03/2022)
New Features:
Improvements:
- add instructions for CMS users in the Quickstart Guide
Bug Fix:
- replace a stupid white text on white background in the drag & drop form code modal
- edit the LCSwitch plugin to make it work with inputs inside labels
version 5.0 - Major update (03/2022)
- upgrade to Bootstrap 5
- remove jQuery except for the plugins that require it
- add Bulma configuration & templates
- add Tailwind configuration & templates
Plugins:
- update all the plugins to their latest version
- rewrite all the jQuery instantiation codes in Vanilla JS for all non-jQuery plugins (in plugins-config/*.xml files)
- add a new Accordion plugin for accordion step forms
- replace jQuery autocomplete by autoComplete.js (vanilla js)
- replace jQuery captcha (realPerson) by js-captcha (vanilla js)
- add jsCaptcha server-side validation
- add hCaptcha plugin
- remove the old recaptcha v2 plugin
- replace the jQuery-Color-Picker by a new colorpicker plugin (vanilla js)
- rewrite the Dependent Fields jQuery plugin in vanilla js
- replace the modal plugin by a new lightweight accessible vanilla js modal plugin
- rewrite the Nice Check jQuery plugin in vanilla js
- replace the Popover and jQuery Tooltip plugin with the amazing vanilla js TippyJs
- activate plugins with data-attributes instead of classnames to avoid conflicts. ie: 'data-input-spinner=true' instead of 'class=input-spinner'
- update & rewrite the lcSwitch JavaScript & replace themes by data-attributes (data-oncolor and data-oncss)
- improve the website accessibility with the new excellent Chrome CSS Overview tool
- remove the "dist" folders in the plugins folders and move the files directly in thir parent folder
- update Bootswatch themes and add them to the Bootstrap 4 + Bootstrap 5 templates
Functions & code:
- replace the MySQL class with the PDO version (https://www.phpclasses.org/package/10844-PHP-Access-MySQL-databases-using-the-PDO-extension.html)
- add a new addheading() method
- add a new buildAlert() static method
- add a new addTimeSelect() method
- remove the unused 'type' argument in addFileUpload() function
- improve the 'sent_message' option behaviour in the sendMail() method
- replace the centerButtons() function with the new centerContent() function
- rename the groupInputs() function by groupElements() for a better consistency
- remove the form inline layout - use horizontzal with grouped fields instead
- split the Form class into PHP Traits to improve the readability of the code and to group the functions in a logical way
- lint code with PHPCS & Sonarlint
Templates:
- add new templates for each framework
- replace All the jQuery code with Vanilla JS code
- replace the complex "email-styles" form with a basic "email-templates" form - easier to understand
Drag & drop:
- Complete update with integration of new frameworks, plugins and features
Responsive File Manager is under Creative Commons Attribution-NonCommercial 3.0 Unported License.
The author kindly allowed me to include it with PHP Form Builder.
PHP Form Builder users can use it without limitation for non-commercial projects.
If you want to use Responsive File Manager in commercial projects, don't hesitate to contact the author and ask him for his agreement. A small donation is welcome.
About
I'm a french web developer; I work on many enthusiastic projects for clients as a freelancer, mainly handmade websites or web applications.
I spend time every day helping people using PHP Form Builder worldwide.