Form Solution

Form Solution is an open source PHP class to ease secure user interface programming.

Generates Form Elements

There are functions to generate option lists of years, months, days, hours, minutes and seconds. Another procedure exists to print an option list of states within the United States of America. Both have optional parameters permitting desired items to be pre-selected. There's also an Email Form function, allowing you to easily avoid spammers harvesting email addresses off of your website. The elements generated are XML compliant, conforming to the W3C's "Strict" Extensible HyperText Markup Language (XHTML) 1.0 DTD standard.

Cleans User Input

User input can't be trusted. Form Solution automatically removes unwanted and potentially harmful characters from input before they ever touch your scripts. Exactly which characters are stripped is up to you. One of our predefined recipes can be used or you can use your own.

Input length is also checked. If it's longer than the size you've determined, the excess is dropped.

Then, field's original information and the $_POST, $_GET, $_REQUEST, $HTTP_POST_VARS and/or $HTTP_GET_VARS are removed to conserve memory and prevent inadvertent use of unchecked input.

Validates and Formats Date and Time Inputs

Makes sure dates and times entered are valid and formatted correctly. Merges individual variables (such as day, month and year) into one variable which you name in a format you specify.

Contains Variables

The information from each field submitted by a form is placed into the object. For example, if your form had an input element using name="Age", the value from that input becomes $Object->Age. Now, you can easily refer to data elements from the form inside functions without having to global every single variable.

Email Contact Form

Form Solution also includes procedure to generate a form that people browsing your site can use to email you. Using a contact form is nice since it keeps spammers from harvesting email addresses off your website.

Inline Documentation

We've started adding documentation in the code itself, using phpDocumentor docblock comments. This process isn't complete, but should be in the near future.


Form Solution is a trademark of The Analysis and Solutions Company.