PHP Classes

File: example_tiny.php

Recommend this page to a friend!
  Classes of Thiemo Kreuz   TM::Apeform   example_tiny.php   Download  
File: example_tiny.php
Role: Example script
Content type: text/plain
Description: Basic textarea example
Class: TM::Apeform
A very abstract web form builder and processor
Author: By
Last change: Updated
Date: 14 years ago
Size: 470 bytes
 

Contents

Class file image Download
<?php

/**
 * Tiny form example. Shows basic use of textarea, error, submit, isValid and
 * display.
 *
 * @author Thiemo Mättig (http://maettig.com/)
 */

require_once("Apeform.class.php");
$form = new Apeform();

$message = $form->textarea("Something");
if (empty(
$message))
{
   
$form->error("Please enter something");
}

$form->submit("Submit something");

if (
$form->isValid())
{
    echo
"Thank you!";
}
else
{
   
$form->display();
}