PHP Form Builder
PHP Form Generator — zero boilerplate, your CSS stack

Bootstrap 4Bootstrap 4 Bootstrap 5Bootstrap 5 BulmaBulma FoundationFoundation Material designMaterial design TailwindTailwind UIKitUIKit

Build any PHP form in minutes — validation, email & database included. No CSS to override, no JS to wire up. Zero lock-in: your code, your server, your rules.

Loved by 5600+ users

5 stars on CodeCanyon (250+ ratings)

Capterra reviews Fazier badge
PHP Form Builder preview

Why PHP developers choose PHP Form Builder

Every PHP form requires the same boilerplate: framework-specific markup, real-time and server-side validation, CSRF tokens, email sending, database wiring. PHP Form Builder eliminates all of it — one coherent PHP API, zero lock-in.

Works out of the box with Bootstrap 4, Bootstrap 5, Bulma, Foundation, Material Design, Tailwind & UIKit — generates native framework markup, nothing to override or fight against.

Here is what it covers:

PHP Form Builder:

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

Who is PHP Form Builder for?

Built for any PHP developer — from first-timers to seasoned engineers:

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


PHP Form Builder at a glance

Frameworks

PHP Form Builder is designed for the most popular frameworks.

No framework

Create your forms in any context with the minimal version of Bootstrap 5 CSS provided.

Drag & Drop

Create your forms without programming using the drag & drop form builder.

300+ Form Templates

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.

Four PHP calls, one working form

The 4-block pattern covers 90% of use cases. Instantiate, add fields, handle submit, render.

  1. 1Instantiate — one line, pick your CSS framework (Bootstrap 5, Tailwind, Bulma…).
  2. 2Add fields — addInput(), addSelect(), addPlugin()… each field is one PHP call. No HTML to write.
  3. 3Handle submit — server-side validation, email, and DB recording wired in the same block.
  4. 4Render — clean HTML5 output + one compiled CSS + one compiled JS. Zero manual asset management.
Read the Quickstart Guide
use phpformbuilder\Form;

// 1 — Instantiate (Bootstrap 5, horizontal layout)
$form = new Form('contact-form', 'horizontal', 'novalidate');

// 2 — Add fields (one PHP call each)
$form->addInput('text', 'user-name', '', 'Full name', 'required');
$form->addInput('email', 'user-email', '', 'Email', 'required');
$form->addTextarea('message', '', 'Message', 'required');
$form->addPlugin('formvalidation', '#contact-form');
$form->addSubmit('submit-btn', 'Send message');

// 3 — Handle submit
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
    $form->validate();
    // send email, record to DB...
}

// 4 — Render (compiles all assets automatically)
$form->render('bootstrap-5', 'en');

Visual form building with the Drag & Drop Generator

Design your form visually — without writing PHP boilerplate.

  1. 1Drag fields onto the canvas — text, select, file upload, date picker and 30+ more field types.
  2. 2Configure each field visually — labels, validation rules, plugins, conditional display, database mapping.
  3. 3Copy the generated PHP code into your project — validation, email and database wiring included.
Try the Drag & Drop Generator

What you get

One download. Everything included. No subscription, no hidden extras.

PHP Form Builder class

The core PHP library — drop it in any PHP project, no framework required. Generates clean HTML5 form markup for 7 CSS frameworks out of the box.

300+ ready-to-use templates

Full PHP source code for every template — contact forms, login, step forms, modals, file upload and more. Copy, paste, adapt.

30+ JavaScript plugins

Datepickers, file uploader, rich text editor, captcha, select plugins, signature pad — all pre-configured. Add any with a single PHP function call.

Drag & Drop Form Builder

Visual form editor that generates copy-paste PHP code. Build forms without writing PHP, then switch to code when you need more control.

Full documentation + code samples

Quickstart guide, class reference, functions reference, and a code samples library with real examples for every feature.

VS Code & Sublime Text extensions

PHP autocompletion for all functions and options — available on VS Code Marketplace and Sublime Text Package Control.

Where to start?

Depending on your preferences:

Quick and easy form building

Drag & Drop
Form Generator
Build your form visually — drag fields, configure options, copy the generated PHP code. No PHP knowledge required.

PHP Beginners

Beginners Guide
Step-by-step tutorial — from installation to your first working form with validation and email sending.

PHP Programmers

Quickstart Guide
Install and ship your first form in minutes — covers the 4-block pattern, plugins, and production compilation.

About functions and how to

Class documentation
Every class, method, option and parameter — with examples. The reference you'll keep open while coding.
Code Samples
Real code for real problems — layout tricks, icon inputs, conditional fields, plugin combos and more.
Functions reference
All functions, all arguments, all defaults — one page to look up any call without digging through source code.

Frequently Asked Questions

Practical answers to the most common questions about PHP Form Builder.

What is PHP Form Builder?
PHP Form Builder is a PHP class library for creating and laying out HTML forms. It provides a visual Drag & Drop builder and built-in PHP functions to generate forms compatible with Bootstrap 4/5, Bulma, Foundation, Material Design, Tailwind CSS, and UIKit — including validation, anti-spam, email sending, and database recording.
Which CSS frameworks does PHP Form Builder support?
PHP Form Builder is compatible with Bootstrap 4, Bootstrap 5, Bulma, Foundation, Material Design, Tailwind CSS, and UIKit. It automatically generates the HTML output adapted to the chosen framework — no markup to override.
Do I need to know PHP to use PHP Form Builder?
Not necessarily. The visual Drag & Drop builder lets you design forms and generate ready-to-use PHP code without writing a single line. For complex or custom forms, experienced PHP developers can use the built-in PHP API directly.
How many form templates does PHP Form Builder include?
PHP Form Builder includes 300+ ready-to-use form templates covering all major CSS frameworks and form types — contact, registration, multi-step, modal, popover, accordion, file upload and more. Every template ships with full PHP source code.
What JavaScript plugins are included?
PHP Form Builder ships with 30+ JavaScript plugins — date pickers, autocomplete, international telephone input, signature pad, file uploader, TinyMCE rich text editor, dependent dropdowns, and more. Each plugin is activated with a single PHP call; all CSS and JS assets are compiled automatically.
Does PHP Form Builder handle form security?
Yes. PHP Form Builder includes built-in XSS protection, CSRF protection, and an Altcha anti-spam filter (GDPR-friendly, no cookies, no third-party service). Server-side validation runs automatically on all submitted form data.
Can PHP Form Builder send form data by email?
Yes. PHP Form Builder includes a built-in email sending function (PHPMailer, SMTP-ready) that formats submitted data into a clean HTML email. You configure recipient, subject, and reply-to with a few lines of PHP. Attachments and custom HTML email templates are also supported.
Can PHP Form Builder save form data to a database?
Yes. PHP Form Builder provides a built-in database recording function that saves posted form data to any MySQL, PostgreSQL, Oracle, or Firebird database table, with automatic type handling and SQL injection prevention. You own your data — no imposed silo, no third-party service.

Features

Themes (Frameworks)

All options are ready to use and will generate HTML markup according to the chosen framework.

The default framework is Bootstrap 5.

If none of the available frameworks powers your website,
PHP Form Builder provides a minimal version of Bootstrap 5 CSS to design your forms.

Bootstrap 4

$form = new Form('my-form', 'horizontal', 'novalidate', 'bs4');

Bootstrap 5 Default

$form = new Form('my-form', 'horizontal', 'novalidate');

Bulma

$form = new Form('my-form', 'horizontal', 'novalidate', 'bulma');

Foundation - v6.4 or higher, with XY grid

$form = new Form('my-form', 'horizontal', 'novalidate', 'foundation');

Material Design

Material Design forms are built with Materialize framework.

You can design your forms with the Material framework both on pages built with Materialize and with Bootstrap 4.

Tailwind

$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');

More details about __construct() here: Main functions > General > Construct

 

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.

Feel free to contact me about any project/request


Other works

PHP CRUD Generator

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

Slider Maker

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

TinyMce Bootstrap plugin

Bootstrap toolbar for tinyMce
TinyMce plugin to insert Bootstrap elements into your page

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