if ($_POST['_submit_check']) {
if (validate_form()) {
process_form();
} else {
show_form();
}
} else {
show_form();
}
function process_form() {
print "Hello, ". $_POST['my_name'];
}
function show_form() {
print<<<_HTML_
_HTML_;
}
function validate_form() {
if (strlen($_POST['my_name']) < 3) {
return false;
} else {
return true;
}
}
?>