|
|
|
CGIemail problems? |
|
Control
Panel Usersguide
|
| |
cgiemail
script is a CGI programming tag which enables an online feedback
form on CGI activated servers. It accepts the results of a
feedback form, and uses a template file to build and construct
an E-Mail message containing those results. This makes it
considerably more flexible than formmail.pl .
How to install a cgiemail script: (available on all Domainhost
hosting accounts)
1. Generate an html feedback form for site visitors to use,
including a "submit" and "reset" button.
Give your input fields sensible names, like "email",
or "firstname".
Two additional files are required to work in conjuction with the
form:
template.txt an E-Mail template which gets automatically filled
out and sent off.
confirm.htm an HTML confirmation message which is displayed when
the visitor submits the information on the feedback form.
2. Adjust the feedback form's action tag to be as follows, and
include the hidden input field:
<form action="/cgi-sys/cgiemail/template.txt"
method="post" name="order">
<input name="success" type="hidden"
value="http://www.yourdomain.com/confirm.htm>
(where 'yourdomain.com' is your registered domain with
Domainhost)
For testing purposes, you may substitute the reference to 'cgiemail'
with 'cgiecho', this will print out the feedback form results
your browser screen without actually sending them by E-Mail.
3. Now you need to create the template.txt file. It can be
created in a standard text editor (eg. WordPad or NotePad).
Simply copy and paste the following text below into the text
editor of your choice.
From: YourCompanyName <info@yourdomain.co.za>
To: [email] Cc: info@yourdomain.co.za
Subject: Submission of Form
For attention: [contactname]
Dear Client
Many thanks for your correspondence!
If you did not sign up with us, or feel that this message has
been misdirected in any way, please let us know by writing to info@yourdomain.co.za.
Information Provided: Company : [companyname]
Contact Person : [contactname]
Physical Address : [adress]
Description : [description]
Phone : [telno]
Fax : [fax]
Email address : [email]
Web site address : [web_site_adress]
Amend the document as required, replacing all the E-Mail
addresses with the relevant addresses to which the results of
the feedback form should be sent.
Amend each of the form field descriptions to correspond with
those specified in your own feedback form. Enter the
corresponding "name" values (from your html code) for
each field into the square [] brackets. Leave the square []
brackets in the template.txt E-Mail template (otherwise the
references within will not get replaced with their values).
When the template.txt template is processed by the cgiemail
script, it replaces all names in square [] brackets with the
form values. If you want to preserve square brackets for some
purpose, prefix them with a backslash, like \[ .
When you have completed the modifications to the file, save it
as template.txt .
4. Now you need to create the confirm.htm file. It can be
created in a standard text editor (eg. WordPad or NotePad).
Simply copy and paste the sample text below into the text editor
of your choice.
Transaction Successful !
A confirmation message will be send within only a few minutes to
the contact e-mail provided.
Amend the document as required. When you have completed the
modifications, save the file as confirm.htm . You might want to
use a confirmation page you already designed in place of
confirm.htm (i.e replace the reference to 'confirm.htm' in the
cgiemail code with the name of your file instead).
5. You may wish to use alternative file names for either the
template.txt or confirm.htm documents. If this is the case,
please ensure that the corresponding references in cgiemail code
refer to your preferred file names instead.
6. Once the above modifications have been completed, upload the
three files in ASCII mode to your 'public_html' directory.
7. Test the form on your page!
--------------------------------------------------------------------------------
Note 1: The template.txt file MUST be uploaded in ASCII mode.
Note 2: If you would like to place these files in a different
folder, be sure to change the path in the above cgiemail code
accordingly. For example, if you want to put them in a
subdirectory called FOLDER, amend the html code of the feedback
form as follows:
EXAMPLE:
<form action="/cgi-sys/cgiemail/FOLDER/template.txt"
method="post" name="order">
<input name="success" type="hidden"
value="http://www.yourdomain.com/FOLDER/confirm.htm"> |
|