The Information Center is a web page with a form where
selected information can be sent to specific email
addresses. The information can be text files, compressed
files, PDF documents, entire web pages, anything that can
be sent as an email attachment.
An Information Center may be created for your own use,
as the site owner. It can be a handy tool for sending
frequently requested information to inquirers.
An Information Center may also be created for use by
your site visitors. It would allow them to select the
information they want and send it to themselves.
This article contains detailed instructions for creating
an Information Center.
In essence, the form provides checkboxes to check the
information to be sent (via email attachment) and a place
for the email address where the information shall be sent
to.
Some Form Security Considerations
Please excuse me for addressing some form security
considerations before the detailed instructions. With
Master Form V4, all can be solved. Yet, it is information
you need to be familiar with.
Master Form V4 has optional automatic submission prevention
functionality. This should definitely be turned on.
Otherwise; spammers could, with little work, attach their
own files and send them to email addresses they specify,
using your server and your installation of Master Form V4
to do so.
Give all your forms protection from automatic submissions.
It is prudent to omit a message text box, when feasible,
from forms that allow users to provide the email address
where the message will be sent. Master Form V4 can block
automatic submission attempts, when it's turned on. It can
not, however, detect inappropriate manual submissions
unless it contains a banned word/phrase or is from a
blocked IP address.
If the Information Center form is for site visitors to
use, consider omitting message fields from the form.
Security considerations are no barrier for Information
Centers, now that automatic form submission protection
has been added to Master Form V4.
Detailed Instructions
Use a specially-named form field to attach a file or files
to an outgoing email when a certain radio button or certain
checkboxes are checked.
The radio button (only one can be checked) or checkbox
fields (any or all can be checked) are named name="conditionalattachment" and their values are the
location of the email template followed by a list of one
or more files to attach, comma and/or space separated.
Here is an example for a checkbox:
Somewhere in the form, an email template must be specified
(usually a hidden field). Otherwise, there would be nothing
to attach documents to. An example email template is shown later
in this article.
The first item in the checkbox (or radio) field value is the
location of the email template. It must be the first item in
the field value and it must match the location of an email
template specified in the name="emailtemplate"
hidden field. (If the form has more than one email
template specified, it must match one of them.)
The second and subsequent items in the value are the
locations of the files to attach. There may be be one
or more files specified.
The files are specified in any of the following ways:
The absolute http://... URL to the file.
The absolute server location of the file.
The server location of the file relative to the document
root. The file location would start with the "/" character.
(The document root is the directory where the domain's main
or index file is located, the file that loads into the
browser when the domain name by itself is typed into
the browser's address bar.)
The server location of the file relative to the location
of the Master Form V4 installation. The file location would
start with something other than the "/" character.
Items in the value are separated with a comma and/or a space.
Build the form with as many checkboxes (or radio buttons)
as your Information Center requires. An working example
Information Center form is below.
Once the information checkboxes/radio buttons have been
built, all that's left is to add an email address field,
maybe also a name field, and, if the form is for your own
use (not for the public), a message textarea field. The
example code has all of these fields already built in.
(If the form is only for your own use, it is a good idea to
put it into a password-required directory on your server.)
The Working Example and the Example Code
The source code for a similar Information Center follows the
working form. Use this Information Center to deliver any of
the available information to yourself.
The code for a complete example is composed of the form
and the email template. Both are below.
The changes the form requires:
Change the form's action attribute value to the URL of
your installation of MasterFormV4.cgi.
Change the form for the location of documents to those
you wish to provide. (The "'Frequently Asked Questions'
web page" checkbox will work even on your site because
the document location is specified as an absolute
http://... URL.)
Replace the automatic form submission prevention code
(JavaScript in the example) to one provided by the control
panel of your installation of Master Form V4.
Here is the source code for the Information Center form.
An email template that can work with the Information Center
form is below.
Change the email template placeholders and content to
reflect the form and your preferences.
Now you are equipped build your own Information Center!
Question:
Did you find this article interesting and understandable? How can it be improved?
Your response is anonymous.
When done typing, click anywhere outside the box. [more info]