Generalform
Support This Project
Home
Download
Instructions
Quick Start Guide
Example 1
Example 2
Example 3
Modify your XHTML

generalform

General form allows you to create web forms that are controlled from a single XML file.The template, form, thank you message and error messages are all contained in one XML file.

General form does not require you to open up write access to a set-up script. Simply edit the database details in local.php then browse to check.php - this displays the commands required to set-up general form, and any corrections required to the form xml.

The form (and all its associated HTML) are enclosed in showform tags. The message the user sees when they have submitted the form correctly (any HTML) is enclosed in reply tags. The insertform tag is used to direct the script where to insert the form or message.

Within the showform tags alert tags are used to check the form and display error messages (alerts). The name attribute indicates the name of the field to be checked, and the regex attribute is the regular expression used to check the field. The HTML to be displayed if the field value does not match the regular expression is enclosed in the alert tags. A full list of the tags and what they do can be found in the instructions.

The php function process_form is called when the user has successfully submitted the form. The shipped script inserts the data into a MySQL database. The helper script will help you create the database, MySQL user and table for the data.

The syntax of the file is as simple as possible. It is based on XHTML. Your starting point when using general form should be a syntactically correct XHTML form. Instructions to modify it for use with general form can be found here.