# Survey Generator
# Version 1.0
# By Mike Calabrese
# http://www.mikecalabrese.com
# 3-4-2001

# This program is available for free on an AS-IS basis.  I am not
# responsible for consequential damages, loss of income or whatever
# else that may happen as a result  of the use of this program.

This program is designed to generate the front end code necessary to have a 
Survey Program on a web site.  T consists of 2 Perl scripts, an HTML file, 
a counter file and this README file.  

IMPORTANT- The output from this program will only work with another Perl Script 
called "The Voting Booth" by Virtual Marketing Technologies and copyrighted 
by Virtual Marketing Technologies, all rights reserved. The script itself is 
called vote.cgi or vote.pl and is available at http://www.scriptshome.com . 
This series of Perl Scripts and the Voting Booth script together will allow 
you to generate working Surveys on the fly.

The way the script works is that you supply the topic, the question and 
anywhere from 2 to 5 answers on the form called surgen1.pl.  This 
information is then passed onto the script called surgen2.pl.  This script 
builds the HTML survey form, inserts the necessary information into that 
form and builds the supporting data file that is used by vote.pl or 
vote.cgi. The following configuration changes need to be made in order 
for these scripts to function properly:  

Regardless of whether you obtained these files via download or email, they 
should be configured directorywise as follows:

	(In your cgi-bin area)
	surgen(directory) 
		README
		surgen1.pl
		surgen2.pl
		surveynumfile

	(In your html docs area)
		surgen(directory)
		surarc.html
		(the survey1.html, survey2.html etc forms that are generated 
		will go here.)

Be sure that all directories, the surveynumfile and the surarc.html form 
have their file permissions set or chmodded to 755 and all perl scripts to 755. 

Be certain that your path to the Perl interpreter is the same on your machine 
as is indicated at the top of the Perl scripts.  Typing "which perl" at the 
command line should answer that.

surgen1.pl- This is the file that you submit the new survey parameters from.  
It's location should only be known to the web site administrator or webmaster. 
There should be no additional configuration required for this file.

surgen2.pl- This file is where most of the configuring takes place.  Please 
make sure that the following variables are properly configured:

	$votingbooth_url_path- This is the exact url path to where your 
	vote.cgi or vote.pl  script resides.  This is the Voting Booth script 
	by Virtual Marketing Technologies.  An example would be:
	"http://www.yourdomain.com/cgi-bin/vote/vote.pl"
 
	$html_survey_directory- This is the exact UNIX path to where your HTML 
	survey forms will reside.  Make sure that there is a trailing slash 
	on this path.  You can call this directory whatever you want.  The 
	example is called "surgen".  An example would be:
	"/exact/unix/path/to/surgen/"

	$url_survey_directory- This is the exact url path to where your HTML 
	survey forms will reside.  Make sure that there is a trailing slash 
	at the end of this url.  You can call this directory whatever you 
	want.  An example would be:
	http://www.yourdomain.com/surgen/ 

	$survey_datafile_dir- This is the exact UNIX path to where your survey 
	data files will reside.  I just put them in the same directory as the 
	html forms but you can put them whereever you want.  Again, be sure to 
	include the trailing slash.  An example would be:
	"/exact/UNIX/path/to/surgen/"

	$want_archive_form- If you want to have an archive form that is up-
	dated each time a new survey is created, set this variable to 1 and 
	uncomment the link that points to the archive html form from the 
	survey form.  If you leave this variable set to 2, the archive HTML 
	form will not be written to.

	$archive_unix_path- This is the exact UNIX path to where the HTML 
	archive form will reside.  I placed the archive form within my HTML 
	docs surgen directory but you can put it whereever you want.  If you 
	chose 2 for the $want_archive_form variable above, you don't have to 
	configure this variable.  An example would be:
	"/exact/UNIX/path/to/surgen/"

	$archive_url_path- This is the exact url path to where the HTML 
	archive form will reside. An example would be:
	"http://www.yourdomain.com/surgen/surarc.html"

	$archive_urlname- This is the name of the archive HTML file:
	"surarc.html"

surveynumfile- This file is read from and written to by surgen2.pl. surgen2.pl 
grabs the number that is in this file and places it within the survey HTML 
form that it creates to make it distinctive.  It then increases that number by 
1 and writes it to surveynumfile.  This file comes with the number 1 in it as 
the default value.  You can set it to whatever positive whole number that 
you like that is less than, say 30 million.

surarc.html- This is the file that shows users your survey archive.  If you 
select this option in surgen2.pl, surgen2.pl will add the survey that you 
just created to this archive HTML page.  surarc.html can be placed anywhere 
that your HTML documents reside but should probably reside in the same 
directory that your HTML survey forms will reside.

Once all variables are configured, be sure that the vote.cgi or vote.pl 
script is properly configured.  you can get this script and supporting 
documents at the Virtual Marketing Technologies website at 
http://www.scriptshome.com .

Once all configuring has been done, simply bring up the file surgen1.pl, fill 
in the blanks and  submit the form. If all of your variables are configured 
properly the next screen should tell you that your survey has been created 
along with a link to it's location.

These scripts have been successfully tested in a UNIX environment.