PHPackages                             pfp/php-form-processor - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Validation &amp; Sanitization](/categories/validation)
4. /
5. pfp/php-form-processor

ActiveLibrary[Validation &amp; Sanitization](/categories/validation)

pfp/php-form-processor
======================

Create webforms on your website in minutes. It has various built-in validation checks and is extendable to allow you to add more features.

1.0.2(8y ago)231MITPHP

Since Apr 29Pushed 7y ago1 watchersCompare

[ Source](https://github.com/Richard1320/php-form-processor)[ Packagist](https://packagist.org/packages/pfp/php-form-processor)[ Docs](https://github.com/Richard1320/php-form-processor)[ RSS](/packages/pfp-php-form-processor/feed)WikiDiscussions master Synced 2w ago

READMEChangelogDependencies (1)Versions (8)Used By (0)

PHP Form Processor
==================

[](#php-form-processor)

PHP Form Processor allows you to create forms on your website in minutes. It has standard validation checks built in, and you can easily extend the various classes to add your own.

### Features

[](#features)

- A lot of standard validation checks
- Easily extendable classes to create your own custom fields
- Separated template files for easy altering of the form's HTML markup
- Google reCAPTCHA integration

Documentation
-------------

[](#documentation)

The more in-depth features are explained with pages on the [wiki](https://github.com/Richard1320/php-form-processor/wiki)

Installation
============

[](#installation)

PHP Form Processor is installed via Composer.

```
composer require pfp/php-form-processor

```

### Initialization

[](#initialization)

After installing it through Composer, you will have to create your field parameters before initializing the form. For a full list of available fields and their parameters, please check out the [list of fields](https://github.com/Richard1320/php-form-processor/wiki/Field-Parameters) page on the wiki.

```
$fields = array();

$fields['name'] = array(
	'label'    => 'Name',
	'type'     => 'text',
	'required' => true,
	'name'     => 'name',
);

$fields['email'] = array(
	'label'    => 'Email',
	'type'     => 'email',
	'required' => true,
	'name'     => 'email',
);

$fields['body'] = array(
	'label'    => 'Message',
	'type'     => 'textarea',
	'required' => true,
	'name'     => 'body',
);

$form_params = array(
	'fields' => $fields,
);

$form = new Pfp\PhpFormProcessor\form($form_params);

```

### Display the form

[](#display-the-form)

After creating a new form object, you can print it out with the `render_form` method.

```
$form->render_form('submissions.php');

```

### Submit the form

[](#submit-the-form)

On the submissions page, you will have to [initialize](#initialize) the form object again with the same parameters. You will also have to pass the form inputted data into the form in order for the validation functions to run.

```
$form->submit_form_data($_POST);

```

### Validation

[](#validation)

The plugin provides numerous validation checks to all the fields. See the full list of [validation functions](https://github.com/Richard1320/php-form-processor/wiki/Field-Class-Tree-&-Validation-Functions) on the wiki.

### Errors

[](#errors)

If there are any errors after running the `submit_form_data` method, the errors and the submitted data is saved in the `$_SESSION` superglobal variable.

```
$form->print_errors();

```

### Data Retrieval

[](#data-retrieval)

Data is retrieved with the `get_field_value` method after `submit_form_data`. You will have to pass it the key from the fields array that was set during initialization.

```
$email = $form->get_field_value('email');

```

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~39 days

Recently: every ~59 days

Total

7

Last Release

3113d ago

Major Versions

0.1.3 → 1.0.02017-05-05

### Community

Maintainers

![](https://www.gravatar.com/avatar/e8e7bec07af2d2f33a06ab3ff99fbd921a1bbcddb560964c61a3739772902550?d=identicon)[Richard\_Hung](/maintainers/Richard_Hung)

---

Top Contributors

[![Richard1320](https://avatars.githubusercontent.com/u/3484558?v=4)](https://github.com/Richard1320 "Richard1320 (38 commits)")

---

Tags

composerformform-validationformsphpphpformform validation

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/pfp-php-form-processor/health.svg)

```
[![Health](https://phpackages.com/badges/pfp-php-form-processor/health.svg)](https://phpackages.com/packages/pfp-php-form-processor)
```

###  Alternatives

[progsmile/request-validator

Simple PHP Request Validator

37114.5k1](/packages/progsmile-request-validator)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
