Using Feedback-forms with a configuration file
By using a configuration file with Feedback-forms, you can choose a combination of actions depending on the system configuration of your server.
Unless you are a provider on www.upenn.edu, feedback-forms can also be used
without a configuration file.
To use a configuration file with Feedback-forms, follow these steps:
- Write the configuration file
- Edit your form
- Check the filepaths
- Set proper file permissions
- Test your form
Write the configuration file
As the person setting up the feedback form using a configuration file, you must
write the configuration file that tells the feedback-forms script how to process your form.
The name of your configuration file must end with a .conf
extension. For example,
In the specified response file, header file, footer file, log file, and/or message
to be emailed
you can use variables
which refer to:
- input values of the form
- certain environment settings allowed by the program
- date and time values
Input values - To refer to an input value, use $F and then the
the input tag "name" that you used in the form.
The following is an example of an input tag in a form:
To refer to the value that the web user has input into this field, use
- <input type="text" name="FullName">
If you wanted to mail this value to yourself, the message section
of your configuration file might include the following:
If the web user inputs "John Doe" into this field,
the string that is actually mailed would be:
- Name: $FFullName
- Name: John Doe
To obtain all possible input names and their values from your form without having to explicitly specify those input names, use $FALLVARS . This will result in a list like:
- FullName: John Doe
- Email_address: email@example.com
- Phone: 215-898-0000
Environment variables -
See a description of
CGI environment variables available from NCSA.
To refer to an environment variable, you would use $E and then the name of the environment variable.
Please note that
some environment variables have been nulled out for privacy reasons.
If you want to refer to the browser that was used when the user
filled out your form, use
To include the user's browser in the message to be mailed,
include a line like the following in the message section of your configuration file:
You will be mailed a string like:
- Browser: $EHTTP_USER_AGENT
- Browser: Mozilla/4.51 [en] (Win95; I)
Use $EALLVARS to obtain all possible names of
environment variables and their values.
Date and Time - The following date and time variables are available:
- $Dsecond - seconds
- $Dminute - minutes
- $Dhour - hour
- $Dday - day of the month
- $Dweekday - day of the week
- $Dyday - day of the year
- $Dmonth - month of the year
- $Dyear - year
- $Disdst - DST/EST flag
See our documentation on specific configuration directives that you can use.
Once you've made your configuration choices, the form tag must be edited accordingly
The form tag is usally made up of two components, the method and the action.
Check the filepaths for all components of
Feedback-forms as specified in your configuration file. If you are FTP'ing your files to the server, make sure that you place the feedback-forms files into the proper locations as specified in your configuration file,
Set the proper
permissions on all your files.
Test your form. If you are having problems, you can contact webtech-help [at] isc.upenn.edu but please include the URL of the form and your configuration file and any error messages that have been returned by Feedback-forms.