[thelist] PHP - centralised processing for multiple forms

Paul Bennett Paul.Bennett at wcc.govt.nz
Thu Sep 7 17:11:32 CDT 2006

Thanks der wert,

Sounds like you've come up with quite the nifty solution :) well done.

For our needs, we need full control of the initial HTML. There's enough variation in the forms across the site to justify hand building each form.

I'm 80% of the way to a workable solution myself which is a variation on the system you've set up.

Keep that code around - I guarantee you it will come in handy :)


-----Original Message-----
From: thelist-bounces at lists.evolt.org [mailto:thelist-bounces at lists.evolt.org] On Behalf Of der wert
Sent: Thursday, September 07, 2006 8:54 PM
To: thelist at lists.evolt.org
Subject: Re: [thelist] PHP - centralised processing for multiple forms

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  


* * Please support the community that supports you.  * *

For unsubscribe and other options, including the Tip Harvester 
and archives of thelist go to: http://lists.evolt.org 
Workers of the Web, evolt ! 

More information about the thelist mailing list