summaryrefslogtreecommitdiffstats
path: root/app/class/form.class.php
blob: e3986904229638db07686d630c76dad9745ea5c8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php

/*
 * Model web-forms and simplify the process of accepting, validating, and sanitizing input
 */
class Form
{
    /*
     * Constructor
     */
    function __construct()
    {
        $this->textFields = array();

        $this->errorlist   = array();
        $this->warninglist = array();
        $this->noticelist  = array();
    }

    /*
     * Add new text field to the form
     */
    function field_text($name, $req = true)
    {
        if ($req !== true)
            $req = false;

        $this->textFields[] = array(
            'name' => $name,
            'req'  => $req
        );
    }
}

?>