PHP code example of tomdabrain / formhandler
1. Go to this page and download the library: Download tomdabrain/formhandler library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
tomdabrain / formhandler example snippets
fh_conf('FH_FHTML_DIR', '/FHTML/');
//include the class (only needed when not using Composer)
include "FH3/class.FormHandler.php";
//when using composer include the autoloader of composer
form->textField("Age", "age", FH_INTEGER, 4, 2);
//button for submitting
$form->submitButton();
//set the 'commit-after-form' function
$form->onCorrect('doRun');
//display the form
$form->flush();
//the 'commit-after-form' function
function doRun($data)
{
echo "Hello ". $data['name'].", you are ".$data['age'] ." years old!";
}