Пример #1
0
     */
    protected function DoSubmit()
    {
        echo "<p><i>DoSubmit(): Form was submitted. Do stuff (save to database) and return true (success) or false (failed processing form)</i></p>";
        return true;
    }
}
// -----------------------------------------------------------------------
//
// Use the form and check it status.
//
session_name('cform_example');
session_start();
$form = new CFormContact();
// Check the status of the form
$status = $form->Check();
// What to do if the form was submitted?
if ($status === true) {
    echo "<p><i>Form was submitted and the callback method returned true. I should redirect to a page to avoid issues with reloading posted form.</i></p>";
}
?>


<!doctype html>
<meta charset=utf8>
<title>Example on using forms with Lydia CForm</title>
<!-- Echo out the form -->
<h1>Example on using forms with Lydia CForm</h1>
<?php 
echo $form->GetHTML();
?>