Generic HTML Form Processor

Generic HTML Form Processor is a free program for facilitating data collection with HTML forms. It parses the input from any HTML form, then it automatically creates a MySQL database with one table in it (if not yet there) containing columns that are named according to the variables that were submitted through the HTML form. Thus, Generic HTML Form Processor relieves users from writing a script that parses form input and writes it into a database as well as from setting up a database.

You can use Generic HTML Form Processor for one-page studies, multiple-page studies, with input validation, random assignment of participants to experimental conditions, skip patterns, and password-protection. For details, see the examples and links at the bottom of this page.

The use of Generic HTML Form Processor is described in:

Göritz, A. S. & Birnbaum, M. H. (2005). Generic HTML Form Processor: A versatile PHP Script to save Web-collected data into a MySQL database. Behavior Research Methods, 37(4), 703-710.

The full text of the article can be downloaded here.

You can download the Generic HTML Form Processor for use on your own server. You need to unzip the file before you can use it.


Accompanying Material

To use the Generic HTML Form Processor on your own server, point the action attribute of your HTML form to where Generic HTML Form Processor resides:

<form method="post" action="path_to_generic_script/generic.php">

To use the Generic HTML Form Processor and MySQL Database on this server, point the action attribute of your HTML form as follows:

<form method="post" action="http://www.goeritz.net/brmic/generic.php">

With multipage studies, paste the following JavaScript snippet within the form tags into each study page except the first:
<script language="JavaScript" type="text/javascript"> var qs = location.search.substring(1); var nv = qs.split('&'); var url = new Object(); for(i = 0; i < nv.length; i++) {eq = nv[i].indexOf('='); url[nv[i].substring(0,eq).toLowerCase()] = unescape(nv[i].substring(eq + 1)); } document.write('<input type="hidden" name="identification" value="'+url["op56"]+'"><input type="hidden" name="counter" value="'+url["nr93"]+'">'); </script>

With multipage studies, paste one line of HTML code within the form tags into each study page except the last. This line defines the hidden variable next_page and its value, which is the location of the next HTML page. An example is shown below, in which sample2.htm is in the same directory as Generic HTML Form Processor:
<input type="hidden" name="next_page" value="sample2.htm">

If the next study page were located on another server or not within the same directory as Generic HTML Form Processor, the value should be set to the absolute URL, for example:
<input type="hidden" name="next_page" value="http://full_path_on_server.net/pagename.htm">


In case you have used Generic HTML Form Processor on the local server, you can retrieve your data here.

Please understand that there are the following limitations to using this public database on the the local server (if you use the Generic Script on your own server there are no such limitations):
- Records that are three months old are automatically and permanently deleted. To avoid data loss, please retrieve your data in time.
- Up to 1000 records per study are saved.
- Up to 70 unique HTML input fields per study are saved.
- The maximum number of characters to be saved per variable is 15.
- Although we are striving to have the server and database up and running at all times, there is no guarantee of that.

Please understand that there are the following limitations to using Generic HTML Form Processor:
- We are not responsible for any data loss or malfunctioning of the script or database you or your respondents might experience.
- We cannot give technical support for free.
- Generic HTML Form Processor is free software placed under GNU General Public Licence.

If you like this software, the author welcomes a voluntary donation in acknowledgment of her work.

Choose Currency: Set Amount: Thank you!

Here is a short troubleshooting checklist in case the script does not run when you put it on your own server:
1. Make sure the Web server functions properly.
2. Make sure PHP is correctly installed and configured.
3. Make sure MySQL is correctly installed and configured.
4. Make sure you have sufficient privileges in MySQL (described in more detail in the BRM article).

Here is the example one-page survey sample.htm.

Here are the three pages of the example multiple-page survey sample1.htm, sample2.htm, and sample3.htm.

Here is the example multiple-page survey sample1a.htm with a JavaScript skip pattern for gender.

Here is the example of a skip pattern with plain HTML.


Miscellaneous

Here you will find SurveyWiz and FactorWiz, which have been written by Michael Birnbaum.

Here are the homes of PHP, MySQL, and Apache.

Here is a tutorial on the use of Generic HTML Form Processor (with input validation, random assignment of participants to experimental conditions, and password-protection) along with example files.

If you use Generic HTML Form Processor in conjunction with the open-source panel management platform phpPanelAdmin to track panelists from the panel into your study, follow these steps:


Copyright (C) 2005 Anja S. Göritz <http://www.goeritz.net>
Please cite the article "Göritz, A. S. & Birnbaum, M. H. (2005). Generic HTML Form Processor: A versatile PHP Script to save Web-collected Data into a MySQL database. Behavior Research Methods, 37(4), 703-710." in works that benefited from Generic HTML Form Processor.