Exemplo n.º 1
0
    $form->saveInSession = true;
    return true;
})));
// Check the status of the form
$status = $form->Check();
// What to do if the form was submitted?
if ($status === true) {
    $form->AddOUtput("<p><i>Form was submitted and the callback method returned true.</i></p>");
    header("Location: " . $_SERVER['PHP_SELF']);
} else {
    if ($status === false) {
        $form->AddOutput("<p><i>Form was submitted and the Check() method returned false.</i></p>");
        header("Location: " . $_SERVER['PHP_SELF']);
    }
}
?>


<!doctype html>
<meta charset=utf8>
<title>CForm Example: New form elements in HTML 5</title>
<h1>CForm Example: New form elements in HTML 5</h1>
<?php 
echo $form->GetHTML();
?>

<?php 
$footer = "footer_mos.php";
if (is_file($footer)) {
    include $footer;
}
Exemplo n.º 2
0
    header("Location: " . $_SERVER['PHP_SELF']);
} else {
    if ($status === false) {
        $form->AddOutput("<p><i>Form was submitted and the Check() method returned false.</i></p>");
        header("Location: " . $_SERVER['PHP_SELF']);
    }
}
$columns = isset($_GET['cols']) && $_GET['cols'] == 2 ? 2 : 1;
?>


<!doctype html>
<meta charset=utf8>
<title>CForm Example: Creditcard checkout with two column layout</title>
<style>
.cform-columns-2 .cform-column-1 { float: left; width: 50%; }
.cform-columns-2 .cform-column-2 { float: left; width: 50%; }
.cform-columns-2 .cform-buttonbar { clear: both; background-color: #ccc; padding: 1em; border: 1px solid #aaa; }
.cform-columns-2 .cform-buttonbar p { margin-bottom: 0; }
</style>
<h1>CForm Example: Creditcard checkout with two column layout</h1>
<p>View this form in a <a href='?cols=2'>two-column layout</a> or in a <a href='?'>standard layout</a>.</p>
<?php 
echo $form->GetHTML(array('columns' => $columns));
?>

<?php 
$footer = "footer_mos.php";
if (is_file($footer)) {
    include $footer;
}