Form expiry example.
Form expiry exampleOne can lower the lifetime of the forms session by setting the 'ttl' value. Setting this higher than the PHP session length (default around 30min) has no effect.
<?php
require_once '../../HtmlForm.php';
$form->addText('username', ['label' => 'User name']);
$form->addEmail('email', ['label' => 'Email address']);
$form->process();
if ($form->validate()) {
echo('<a href="">back</a>');
echo('<pre>');
var_dump($form->getValues());
echo('</pre>');
$form->clearSession();
} else {
?>
<!DOCTYPE html>
<head>
<link rel="stylesheet" type="text/css" href="../../lib/css/depage-forms.css">
</head>
<body>
<?php echo($form); ?>
</body>
<?php
}