dev-master
9999999-dev https://github.com/gnat/simple-php-formAutomatically generate and handle input forms in PHP.
Zlib
The Requires
- php ^5.3.0 || ^7.0
helpers email form validation response forms input feedback warnings
Wallogit.com
2017 © Pedro Peláez
Automatically generate and handle input forms in PHP.
, (*1)
Automatic HTML <form> with validation, messages, warnings and more!, (*2)
text, textarea, dropdown, checkbox, radio and hidden
required, email, phone, number, lengthmax *, lengthmin *, sizemax *, sizemin *
add('name', 'text', '', ['required'], 'Name', '', 'Your name is required.');
$form->add('email', 'text', '', ['required', 'email'], 'Email', '', 'Your email is required.');
if($form->validate()) // Did the form validate successfully?
{
// Get data: $form->get('name'); ...
// Success ! Send an email or register user in a database somewhere...
$form->reset(); // Reset to default form.
}
?>
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" media="screen" href="css/simplephpform_default.css" />
</head>
<body>
<?php echo $form->display(); ?>
</body>
</html>
This is a zero dependency library., (*3)
Just drag SimplePHPForm.php into your project and require('SimplePHPForm.php');, (*4)
Optionally add the assets from examples/css and examples/images to your project., (*5)
, (*6)
Forms, User Feedback, Model View Controller, PHP 8 Compatible, PHP 8+, email, input, simple, lean., (*7)
Automatically generate and handle input forms in PHP.
Zlib
helpers email form validation response forms input feedback warnings