diff options
Diffstat (limited to 'app/class/form.class.php')
-rw-r--r-- | app/class/form.class.php | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/app/class/form.class.php b/app/class/form.class.php new file mode 100644 index 0000000..e398690 --- /dev/null +++ b/app/class/form.class.php @@ -0,0 +1,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 + ); + } +} + +?> |