PHP code example of dimensi0n / simple-form

1. Go to this page and download the library: Download dimensi0n/simple-form 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/ */

    

dimensi0n / simple-form example snippets


$form = new \SimpleForm\Form('Login');
        $form->addInput('email', 'email', 'Email address') // name, type, label
		   ->addInput('password', 'password', 'Mot de passe') // name, type, label
           ->addSubmit('Submit'); // content

echo $form->renderHTML;

$values = $form->getValues($_POST); // check if all fields are filled, also applies trim(), stripslashes() and htmlspecialchars()

if (isset($values['empty'])) {
    foreach($values['empty'] as $empty_value) {
        echo $empty_value.' is empty'; // 'Name of the empty field' is empty
    }
} else {
    echo 'Email : '.$values['email'];
    echo 'Password : '.$values['password'];
}

$form = new \SimpleForm\Form('Login');
        $form->addInput('email', 'email', 'Email address') // name, type, label
		   ->addInput('password', 'password', 'Mot de passe') // name, type, label
           ->addSubmit('Submit'); // content

<div class="container">
    <?= $form.formStart()