1.3.1. Explanation/use
of:
a.) CONTACT.HTML
FM SiteMail contains a hidden variable which
is called fn in contact.html - contact.html do not have to be named contact.html - you can
give it any name you would like to use.
#When looking at this here code you'll see the
use of the hidden var "fn" :
# $rsp = $fields{'fn'} . "_response.txt";
Inside contact.html there will be a hidden
form variable called fn
'fn' acts as a placeholder for whatever value
'fn' has.
In our case fn = contact; so that the other files (starting with contact*) can work with
the script.
To change fn:
* open contact.html with a web editor (eg. frontpage)
* right-click anywhere inside the dotted square
* choose 'form properties' from the popup menu
* click advanced
* select fn & click modify
* change fn's value to support (example)
If you decide to rename your fn value in
contact.html to 'support' you must also rename all the other files that started with
contact ( you will then have for example: support.txt, support_error.html,
support_response.txt & support_thanks.html)
b.) CONTACT.TXT
This file contains all the error messages used
by contact.html.
Text inside this file gets displayed when the user forgets to enter a
field that is required by contact.html.
How to set up required fields (fields that has to be completed
by users) :
You will most probably want to add fill-in-boxes to contact.html
Lets use a fill-in box/field with the name 'phone' for example.
Now open contact.txt and place the word 'phone' in it.
(the name of the fill-in-box)
After phone place a colon - after the colon place error text that will be
displayed to the user when he tries to submit the form without filling
in something in the phone field or fill-in-box.
The line inside contact.txt should look something like this:
'phone:Please supply us with your phone number'
If you later don't want phone to be a required field; simply delete the above error
message line from contact.txt
c.) CONTACT_ERROR.HTML
If you open this file in a web editor you'll
see the text '%%problem%%'.
Remember those error messages from contact.txt? Depending on the user's mistake a
corresponding message will be displayed in '%%problem%%'.
d.) CONTACT_THANKS.HTML
This page merely contains a message
like...
"We will tend to your request as soon as
possible. " (customizable, of course!)
...that is displayed to the user once all fields in contact.html have been
correctly filled.
1.3.2. When all files have been set up to your
liking:
Upload all files from your cgi directory
[mail.cgi, *.html, *.txt] to your cgi-bin/mail (the path YOU used in mail.cgi) directory
and Chmod their file attributes to 755; Upload "contact".html to your www
dir.
1.3.3. Test
Test this script by launching it through
your web-browser
for example : http://yourdomain.com/contact.html
will execute the script
at http://home/yourdomain.com/cgi-bin/mail/mail.cgi