[thelist] PHP - centralised processing for multiple forms

der wert derwert at hotmail.com
Thu Sep 7 03:53:41 CDT 2006

Hi Paul, sorry for the delay when I first saw your email I started coding 
which I tend to do sometimes, the result I think is nifty, what I've created 
isn't finished but it's at a pretty good stage.

what I created what a single php file that includes a conf file of form(s) 
to be created
the config file uses an array to store the configuration of the form to be 
here's an example of a one of these config arrays

$form['1']['fields']['Name']['regex']='[a-zA-Z ]{1,12}';










$form['1']['action']['emailto']='form at example.com';

you can also choose if you want XHTML or HTML to be generated

what you do is put arrays for the forms in the config file
then in order to put a generated form on your page you would do like so

define('_form', '1'); //this tells it to generate form 1 from the config 
require_once('./quickforms.php'); //the file that does all the hard work

a picture of the end result with a css style sheet applied is as follows

the form input is determined to be valid or not according to the regex in 
the conf file

the point of the project is to the point where you submit the form then it 
displays if the data entered was valid or not according to the regex, I've 
been busy with school and work so that is why it is not finish as of now, 
but I still like the turnout so far, let me know if you'd like the code or 


Get real-time traffic reports with Windows Live Local Search  

More information about the thelist mailing list