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.
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">
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>
<input type="hidden" name="next_page" value="sample2.htm">
<input type="hidden" name="next_page" value="http://full_path_on_server.net/pagename.htm">
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.
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
to track panelists from the panel into your study, follow these steps: