Welcome to PHP Form Builder
PHP Form Generator Class - Save tons of programming hours

PHP Form Builder is a complete library that is based on a PHP class, allowing you to program any kind of form and layout them using some simple functions.

PHP Form Builder preview

PHP Form Builder is conceived for use with the most popular frameworks: Bootstrap 4, Bootstrap 3, Material Design, Foundation and can be configured for any other use.

It allows you to build any form from scratch or by customizing one of the 120+ templates provided

Optimized for very fast loading and maximum security.

Loved by 2000+ users

starstarstarstarstar 5 stars rating on Codecanyon (160+ ratings)

Buy PHP Form Builder Now

Customer Reviews

Overview

PHP Form Builder is a simple but powerful PHP Form class with which you can create complex forms easily.

PHP Form Builder is ready to use with Bootstrap, Foundation and Material Design themes, but can be easily adapted for other frameworks or as standalone.
All you need is to match Form options with your framework.

Documentation is well-adapted for all types of users: PHP beginners as well as confirmed programmers.

Please see Where to start ? section to find the best place to start depending on your skills.

PHP Form Builder at a glance

Build Bootstrap Forms

PHP Form Builder's default settings are Bootstrap ready.

PHP Form Builder is fully compatible with Both
Bootstrap 4 and Bootstrap 3.

Build Material Forms

Material forms are part of PHP Form Builder's package.
Switch from Bootstrap to Material with a single line of code.

Build Foundation Forms

Foundation now added to PHP Form Builder's package.

Build Standalone Forms

PHP Form Builder can adapt generated html to any framework,
or generate simple standard HTML5 elements.

120+ Form Templates

Each template is given with code you can easily copy / paste.
Code includes Live & Server side Validation and Email sending

Email Sending

Built-in function to send posted values easily.
Support for attachments and Custom E-Mail templates

Easy Contact Form

Shortcut function to build contact form in 2 minutes

Powerful jQuery plugins integration

Don't waste your time to include css & js files, generate js code, ...
PHP Form Builder will add any jQuery plugin in a very easy way and do all this job for you.

20+ jQuery plugins included

Best jQuery Form plugin included in 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

Server-side validation

Validate any field with any condition.
Your page will automagically scroll to user error if fields are not filled correctly.

Conditional logic

Show / Hide fields depending on user's choices
One easy function for all logic. Conditional fields can be nested.

Special forms

Ajax forms, Step forms, Modal forms, Popover forms, Accordion forms: Simple and easy integration with templates and full documentation.

- Fast & Efficient Professional Support -

We take care of each customer
and do our best to give efficient help.

License and Registration

License

1 License = 1 project

If you want to use PHP Form Builder on several websites you've got to buy a new license for each one.

Standard license vs. extended license

Registration

Before using PHP Form Builder you must register your copy.

Registration is for lifetime & just have to be done once for each installation (localhost/production server).

If you change your installation directory:

  1. open phpformbuilder/register.php to unregister your copy
  2. move your folders where you want to
  3. open phpformbuilder/register.php to register your new path

Package Structure

PHP Form Builder's package includes the Form Builder itself, the documentation and all the templates.

You don't have to upload all the files and folders on your production server.

Documentation and Templates are available online at https://www.phpformbuilder.pro/.
There's no need to upload them on your production server.

You only have to upload the following directories on your server:

The phpformbuilder folder structure

  • your-project-root
    • phpformbuilder Main form builder files including all the plugins
      • database Contains Mysql class. Not required if you have no database.
      • mailer Contains phpmailer class, the email templates and utilities to sanitize the emails contents and inline the emails css.
      • plugins Contains all the plugins. You can remove the ones you don't use in your forms.
      • plugins-config Contains all the plugins configuration files ("domready" codes stored into xml files). You can remove the ones you don't use in your forms.
      • plugins-config-custom Empty folder to store your plugin configurations files if you customize.
      • Validator PHP Validation class.
      • Form.php PHP Form Builder's main class.
      • FormatHtml.php PHP Class to beautify HTML output code
      • FormExtended.php Extends PHP Form Builder's main class with useful shortcut functions.
      • register.php required to register & activate your PHP Form Builder copy..
      • server.php file used for debugging purpose if you encounter paths issues on your server.

Sublime Text plugin

PHP Form Builder Sublime Text plugin is available on Package Control

The plugin adds auto-completions for all Form Builder functions.

PHP Form Builder Sublime Text Completions

Where to start ?

Depending on your php knowledge:

PHP Beginners

Beginners Guide
Tutorial for PHP beginners including full detailed explanations

PHP Programmers

Quick start Guide
Quick and easy start with minimum required.

About functions and how to

Class documentation
Full class documentation.
Code Samples
F.A.Q. with code examples to help with layout, icons, plugins, dependent fields and so on.
Functions reference
All functions & arguments.

Build a fully-working contact form in 2 minutes without any knowledge

Contact form in 2 minutes
If you don't want to learn, just want a working contact form.

Features

Themes (Frameworks)

Bootstrap 3

Default'theme is Bootstrap 3.

All options are ready to use, and will generate all Bootstrap's markup and classes.

Bootstrap 4

Create your forms with Bootstrap 4 markup and classes.

Foundation

Create your forms with Foundation markup and classes.

Material Design

Material Design forms are based on Bootstrap 3.

Markup and options are exactly the same for both.

To switch from Bootstrap to Material Design, just add bootstrap-material-design plugin

Upgrade PHP Form Builder

  1. Backup your phpformbuilder folder
  2. Replace your old phpformbuilder folder with the new one
  3. Copy your license.php from your old installation to the new one
  4. Copy your phpformbuilder/database/db-connect.php from your old installation to the new one
  5. If you customized the following files/folders, copy them from your old installation to the new one:
    • phpformbuilder/mailer/email-templates-custom
    • phpformbuilder/plugins-config-custom
    • phpformbuilder/FormExtended.php

Upgrade from V 2.x to V 3.x

More efficient & simple than ever, this release contains some code simplifications, new features and new syntax to send emails.

All V 2.x features are still available using old V 2.x syntax, except for email sending.

sendMail() and sendAdvancedMail() functions have been merged into a single sendMail() function (see details below)

 

Plugins path

No need to setup plugins path anymore (it's now automagically detected).
(phpformbuilder/plugins-path.php has been removed)

 

Server-side validation

No need to include Validator files
Required fields can now be validated automagically


/* OLD CODE V 2.x */

include_once rtrim($_SERVER['DOCUMENT_ROOT'], DIRECTORY_SEPARATOR) . '/phpformbuilder/Validator/Validator.php';
include_once rtrim($_SERVER['DOCUMENT_ROOT'], DIRECTORY_SEPARATOR) . '/phpformbuilder/Validator/Exception.php';
$validator = new Validator($_POST);
$required = array('user-name', 'user-first-name', 'user-email', 'user-phone', 'message');
foreach ($required as $required) {
$validator->required()->validate($required);
}
$validator->maxLength(100)->validate('message');
$validator->email()->validate('user-email');

/* NEW CODE V 3.x */

// create validator & auto-validate required fields
$validator = Form::validate('contact-form-1');

// additional validation
$validator->maxLength(100)->validate('message');
$validator->email()->validate('user-email');

 

Email sending

SendMail() function has now full capabilities to send attachments, add cc/bcc and a lot more.
See sendMail function for complete features list.


/* OLD CODE V 2.x */

$from_email = '[email protected]';
$adress = addslashes($_POST['user-email']);
$subject = 'phpformbuilder - Contact Form 1';
$filter_values = 'contact-form-1, submit-btn, token';
$sent_message = Form::sendMail($from_email, $adress, $subject, $filter_values);

/* NEW CODE V 3.x */

$email_config = array(
'sender_email'    => '[email protected]',
'sender_name'     => 'PHP Form Builder',
'recipient_email' => addslashes($_POST['user-email']),
'subject'         => 'PHP Form Builder - Contact Form',
'filter_values'   => 'contact-form-1'
);
$sent_message = Form::sendMail($email_config);

Changelog

version 4.0 (Major release - 12/2018)


New Features:
- new Material forms - use with Bootstrap 4 OR materialize framework as standalone
  more informations: https://www.phpformbuilder.pro/documentation/class-doc.html#frameworks
- new material-datepicker plugin for Material forms + Bootstrap 4 forms
- add Select2 Material theme
- new setMode function
  development mode loads the original plugin CSS & Javascript dependencies
  production mode (default) compile & compress all the plugins CSS & Javascript dependencies
- new adAddon function to add button & text addons to input & select dropdowns
- add templates with addons examples: phpformbuilder/templates/[framework]/input-with-addons.php
- update jQuery Form Validation plugin to latest - now compatible with Foundation
- add jQuery Form Validation icons
- add jQuery Form Validation DEBUG mode
- update Bootstrap Select plugin to latest - now compatible with Bootstrap 4
Improvements:
- rewrite all the plugins configuration
  now most plugins accept HTML5 data-attributes for easy configuration
- rewrite all website, documentation & code examples for Bootstrap 4
- change the website structure
  now all the plugins have a dedicated page with code & examples
- remove the smtp option from sendMail function
    now smtp is automatically enabled when $smtp_settings are filled.
- improve Ajax scripts loading (avoid browser console warning about deprecated Synchronous XMLHttpRequest on the main thread)
Bug Fix:
- solve plugins URL detection with paths containing uppercase letters
- update Emogrifier to latest version 2.0 (email inline css)
- edit phpformbuilder/mailer/phpmailer/extras/htmlfilter.php to remove php7 warning
- now ladda buttons have correct settings when using different ladda configurations simultaneously
Misc.:
- the default framework is now Bootstrap 4 (was previously Bootstrap 3)
- remove the old Material Design forms based on Bootstrap 3 + old version of Materialize
- remove the old ugly jQuery-ui datepicker
- remove the "pickadate material" config
- remove deprecated templates which used the deprecated jQuery File Upload plugin
- remove deprecated jQuery File Upload plugin

version 3.6.2 (08/2018)


Improvements:
- update server-side validation functions to accept empty values,
    except for the validators whose internal logic make values required.
    Details available here: https://www.phpformbuilder.pro/documentation/class-doc.html#php-validation-methods
Bug Fix:
- fix licensing system timeshift issue
- fix invalid feedback message with iCheck + bs4
- fix Ladda plugin behaviour with grouped buttons

version 3.6.1 (07/2018)


Improvements:
- improve html parsing
- disable onload live validation
- improve dynamic fields template 2 behaviour
- improve dependent fields selectors parsing with regex
Bug Fix:
- fix centered button groups with Foundation grid

version 3.6 (06/2018)


New Features:
- add required registration
- add LC-Switch plugin
Improvements:
- update documentation
- update PHPMailer to latest (6.0.5) - (wrong version numbers in src files, same issue in PHPMailer github)

version 3.5.2 (05/2018)


Improvements:
- Add support for PHP without mbstring extension
Bug Fix:
- recaptcha server-side validation errors now display correctly with bs4 (they where hidden by bs4's display:none css)
- fix server-side Recaptcha validation (which always returned true before)
- fix server-side validation errors markup inside input groups

version 3.5.1 (04/2018)


Bug Fix:
- fix live validation issue with invisible recaptcha

version 3.5 (04/2018)


New Features:
- switch Foundation forms to Foundation 6.4+
  older versions are still available as 'foundation-float-grid' framework
  doc: /documentation/class-doc.html#frameworks
- add Invisible Recaptcha plugin
  replace all recaptcha v2 in templates with invisible recaptcha except with ajax forms & multiple modals
- add new "deferScripts" option to defer the loading of the plugins scripts
  default value: true
Improvements:
- all scripts are now loaded with defer
- add code to reload uploaded files if forms are sent with errors in fileupload templates
Bug Fix:
- fix plugins loading with ajax and forms reloaded with errors

version 3.4 (04/2018)

IMPORTANT

This release includes a new fileuploader plugin with awesome new features.

The old fileupload plugin is now deprecated and will be removed in the next incoming version.


New Features:
- add new awesome fileuploader plugin including image crop/resize tools
Improvements:
- switched Bootstrap 4.0.0-beta.3 to 4.1
- improve plugins code if several forms are using the same selectors & same plugins
- Add Bootstrap 4 Form Validation (live jQuery) i18n support in phpformbuilder/plugins-config/formvalidation.xml
- Rewrite step forms code
Bug Fix:
- fix php 7.2 warning with email sending - Parameter must be an array or an object that implements Countable
- Formvalidation now works fine with intl-tel-input and i18n (custom languages)
- Email sending will no more fail with empty css file template

version 3.3 (12/2017)


New Features:
-   add ajax option (easy Ajax loading to load the forms in any html file)
    Plays well with any CMS (Wordpress, Joomla, Drupal, ...)
-   add Documentation and screencast to use with CMS
-   add Image Picker plugin
-   add Image Picker Templates
Improvements:
-   upgrade PHP Mailer to the latest version
-   auto-filter token and submit buttons from email contents
Bug Fix:
- several minor fixes

version 3.2 (12/2017)


New Features:
-   add Bootstrap 4 support
-   add 40 Bootstrap 4 Templates
-   add Select2 plugin - https://select2.github.io/
-   add Ladda plugin - https://github.com/hakimel/Ladda
-   add intl tel input plugin - https://github.com/jackocnr/intl-tel-input coupled with formvalidation
-   add centerButtons(boolean) function
-   add new options:
        buttonWrapper                   (element)
        centeredButtonWrapper           (element)
        centerButtons                   (boolean)
        verticalCheckboxLabelClass      (classname)
        verticalRadioLabelClass         (classname)
Improvements:
-   upgrade all plugins to the latest version
-   upgrade PHPMailer to latest 6.0 (required PHP 5.5+)
-   improve documentation
-   improve the use of several recaptchas on the same page
-   reopen modal if the form has been posted with recaptcha error
-   validate all generated code with Bootlint & W3C
    note: some of the included plugins (Bootstrap select, iCheck, jQuery file upload) generate Bootlint non-valid html
-   add Russian and Ukrainian languages to the server Validator (thanks to Ramstud)
-   update dynamic fields form 1 template with required dynamic fields and server + live validation
Bug Fix:
- php warning with button group + label
- php warning with inline forms

version 3.1 (07/2017)


New Features:
- add $combine_and_compress argument to printIncludes() function to combine and minify all plugin dependancies (css & js files)
  (default: true) - details at https://www.phpformbuilder.pro/documentation/class-doc.html#printIncludes
- add Foundation framework options and templates
- add Nice Check plugin to style Radio buttons and Checkboxes
- add templates theme switcher for Bootstrap & Material forms
Improvements:
- auto combine and minify all plugin dependancies (css & js files)
- make recaptcha fully responsive
- allow to wrap radiobuttons with addInputWrapper function
- switched setPluginsUrl() function to public and add "$forced_url = ''" optional argument to allow manual plugins URL configuration if user's server is misconfigured.
- escaped commas now recognized in dependent fields (value with comma can be escaped)
- rename "dependant fields" plugin to "dependent fields" (sorry ... confusion with French spelling ...)
Bug Fix:
- fix issues with complex nested dependent fields and jQuery live validation
- fix issue with custom class attribute and addCountrySelect function
- fix issue with radio button attributes on material forms
- fix css overflow with lists into dependent fields

version 3.0 (Major release - 05/2017)

IMPORTANT

More efficient & simple than ever, this release contains some code simplifications, new features and new syntax to send emails.
To upgrade from version 2.X, see Upgrade PHP Form Builder section.


New Features:
- add static function Form::validate('form-id');
  Form::validate function instanciates validator and auto-validate required fields
- merge sendAdvancedMail and sendMail function
- add helperWrapper option
- add addHelper($helper_text, $element_name) shorcut function
- add "inverse" argument to Dependent fields
- auto-disable dependent fields when they're hidden
- add custom plugins config directory
- public non-static methods can now be all chained
Improvements:
- auto-locate plugins directory & url (phpformbuilder/plugins-path.php has been removed)
- add optional $fieldset_attr & $legend_attr arguments to startFieldset() function
- improved jQuery validation with Bootstrap collapsible panels
- now up to 12 fields can be grouped into same container
- add Validator Spanish language (Thanks Hugo)
- minor performance improvements
Others:
- add tooltip-form template
- update templates according to new features
- update documentation

Version 2.3 (02/2017)


New Features:
- add jQuery real time validation plugin ($50 value)
Improvements:
- better errors management on plugins path errors
- add support for several recaptchas on same page
Bug Fix:
- removed crossOrigin warning using wordcharcount plugin
- solved z-index issue with selectpicker & modal

Version 2.2.2 (01/2017)


Improvements:
- add support for several modal forms on same page
- add support for several popover forms on same page
- add several modal forms on same page templates (Bootstrap + material)
- add several popover forms on same page templates (Bootstrap + material)
- better errors management on plugins path errors
- minor improvements in documentation

Version 2.2.1 (01/2017)


Bug Fix:
- add "phpformbuilder/mailer/phpmailer/extras" folder to package, missing in previous release

Version 2.2 (01/2017)


Security:
- update PHP Mailer Class to latest (5.2.21)
Improvements:
- auto-trigger dependent fields on form load
- improve main form attributes compilation
Bug Fix:
- add one missing translation in de
- remove php warning on selects with no option
- fix missing line breaks in emails

Version 2.1 (10/2016)


New Features:
- add Recaptcha plugin
- update Fileupload plugin to latest version
- add new template default-db-values-form.php
- add new template fileupload-test-form.php
- add default values [from database|from variables] in 'how-to' documentation
- add a 4th optional argument to group 4 inputs in same wrapper
Bug Fix:
- missing required sign with radio and no classname

Version 2.0.3 (08/2016)


Improvements:
- Rewritten Dynamic Fields Template javascript to match any field
- update sendAdvancedMail() function to automagically convert posted arrays to comma separated lists in email

Version 2.0.2 (08/2016)


Bug Fix:
- fix dependent select with checkboxes
- fix custom attributes with checkbox groups

Version 2.0.1 (08/2016)


Improvements:
- Add Dynamic Fields Templates
Bug Fix:
- fix php7 warning (upload button not shown) using addFileUpload() function

version 2.0 (Major release - 07/2016)

IMPORTANT

All features are backward-compatible, except addCheckbox() function: 3rd argument ($name) has been removed.

(see examples or main class doc for more informations).


New Features:
- add Material Design plugin
- add Material Design templates
- add Modal plugin
- add Popover plugin
- add Pickadate plugin + Pickadate Material
- add XSS protection
- add CSRF protection
        (documentation: https://phpformbuilder.pro/documentation/class-doc/index.html#security)
- add 2 functions for dependent fields:
        -   startDependentFields($parent_field, $show_values) ;
        -   endDependentFields();
- add Autocomplete plugin
- add support for input grouped with button (ie: search input + btn)
- automatic scroll to first field with error
- add third argument to render function to allow returning form code instead of echo
Improvements:
- restructure package
- rewrite all documentation
- add php beginner's guide
- rewrite & optimize several Form functions
- better error fields rendering for grouped fields
- zero value will not be anymore considered as empty
- checkboxes are automagically converted to an array of indexed values.
- add new argument to render, printJsCode & printIncludes functions to return code instead of echo.
- beautify output if debug enabled
Updates:
- update Bootstrap Select plugin to latest version (v1.10.0)
Bug Fix:
- fix validation custom error message with 'between' function
- fix validation errors with dates + hasSymbol function
- fix wrong comma added in some cases with select option attr.

Version 1.3.1 (10/2015)


Bug Fix:
- fix reply_to issue in sendAdvancedMail function

Version 1.3 (05/2015)


Improvement:
- improve register / clear system
New Features:
- add Country select plugin
- add Bootstrap select plugin
- add Passfield plugin
- add Icheck plugin

Version 1.2.7 (03/2015)


Bug Fix:
- fix word-char-count plugin used on the same page with tinyMce + word-char-count.

Version 1.2.6 (03/2015)


Improvement:
- register array fieldnames in session to keep values when validation fails.

Version 1.2.5 (02/2015)


Improvement:
- add word-char-count support with tinyMce

Version 1.2.4 (12/2014)


New Features:
- add support for select into input groups
Improvements:
- input groups documentation & examples fully detailed

Version 1.2.3 (12/2014)


New Features:
- add database utilities with Myql class
- add tinyMce (Rich Text Editor) plugin with responsivefilemanager
Improvements:
- add debug argument to print css/js includes & js code on screen
- support of multiple fileUploads on the same page

Version 1.2.2 (10/2014)


New Feature:
- add word / character count plugin
Bug Fix:
- Fix object context error with php < 5.4

Version 1.2.1 (10/2014)


Updates:
- improve email sending with attached files

Version 1.2 (10/2014)


New Features:
- add sendMail function
- add sendAdvancedMail function
- add groupInputs function
- add btnGroupClass option

Updates:
- update fileUpload plugin to last version

Bugs Fixes:
- Fix default checkbox wrapper html
- Fix plugin path with only fileUploads

Version 1.1 (09/2014)


Bugs Fixes:
- Fix Validator compatibility with 32/64 bit systems
- Fix object context error with php < 5.4

Version 1.0 (09/2014)


PSR2 Standard support
Check for security vulnerabilities
Add documentation

Sources & Credits

Thanks so much to:

About Responsive File Manager

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 are allowed to use it without limitation for non-commercial projects.

If you want to use Responsive File Manager in commercial projects, please 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 project for clients as freelancer, mainly handmade websites or web applications.

I spend time each day helping people using PHP Form Builder all over the world

Feel free to contact me about any project / request


Other web tools sold on Codecanyon:

PHP CRUD Generator

PHP CRUD Generator
PHP CRUD Generator
Simple application to build Bootstrap backoffice for your website

Slider Maker - jQuery slideshow builder

jQuery Slideshow builder
How to build jQuery slideshows & galleries without coding
Login to admin panel and build high quality responsive slideshows in a visual way

TinyMce Bootstrap plugin

Bootstrap toolbar for tinyMce
TinyMce plugin to insert Bootstrap elements into your page
Wordpress & Joomla versions available

Others:

DMCA Sender - Anti-Piracy solution

DMCA Sender - Anti-Piracy solution
DMCA Sender - Online SaaS application to find illegal download links to your softwares & applications.
Auto-send your DMCA Takedown Notice

Subscribe to our mailing list
Keep informed of the latest updates - maximum 2 or 3 posts per year

* indicates required