CGI Scripts: Web Message Board
A web message board (AKA wwwboard or forum) is an alternative to
mailing lists, It allows users to read threaded messages from your
web site and allows them to post their own. Also, available is a
web board admin script that allows you to delete any message or
range of messages from your web message board.
To use the web message board CGI, you first need to create a wwwboard
directory in your public_html directory. Then, in your wwwboard
directory, create another directory called messages . This
directory is where the message files reside. You can run multiple
message boards on your web sites, which is discussed a bit later
in this document. Next, you will need to create a web page with
the appropriate input fields and hidden options. Then you must link
this form to a web page on your site. Generally, this file is called
wwwboard.html. However, if you are running multiple message boards,
this filename may be different. Once this is done, users can then
read/post from your site.
Create the required directories
The first step is to create the wwwboard directory in your
public_html directory followed by a messages directory.
If you are running multiple message boards, you will create a new
subdirectory directory and insert the messages directory in there.
The path to these multiple directories is defined in the www.html
file. Here is an sample layout for one, then many message boards:
| One message board |
Multiple message boards: |
 |
 |
Globalserve Customers: If your website resides in /web_site/public_html,
make sure that you create a /public_html directly in your
home directory as illustrated above. This is separate from your
/web_site/public_html .
:Download the sample HTML files
The next step is to download and save locally the sample
web board HTML files You can use these as a base for your wwwboard
web page or as a guide on how to modify your existing wwwboard page.
You will need the winzip utility
to uncompress the sample file zipfile.
Edit the files as required and upload them to your web site It
is important to note that the web message board requires that the
comments in wwwboard.html be maintained. If they are removed or
reorganized, the message board will fail to function.
What each file does
| wwwboard.html |
This is the main message board file. Message titles are placed
in this file and messages are threaded. |
| wwwadmin.html |
The interface for maintaining the wwwboard. You must edit
this file if you wish to use the administration CGI to selectively
delete messages from your message board. You need not customize
the look and feel of this file because you, the webmaster, are
the only one going to be using it. |
| faq.html |
Default frequently asked question file. There is a link in
the wwwboard.html that points to this file. You can optionally
leave this file out or use your own FAQ. |
| data.txt |
This file defines the current message number in the message
board. It is used to create the filename of messages in the
messages directory and to store the next message number. Only
change this file if you are reinstalling a web board. |
| passwd.txt |
This is the password for accessing the administrative script.
The default username is WebAdmin and the default password is
WebBoard. The admin CGI will allow you to change this username/password.
Do not edit this file directly. Also, it is highly recommended
that you immediately change the password when you set up the
wwwadmin.html file. |
Fields
The web message board script relies on visible and hidden HTML
form tags to get the necessary information to create new messages
on the web message board. The following table provides a list of
the tags used.
The following tags are used by the wwwboard.html file (tags
marked with an * are also used in wwwadmin.html):
| Tag Name |
Type |
What It Does |
| name |
visible |
Real name of the User |
| email |
visible |
Email address of the user. |
| subject |
visible |
Message subject |
| body |
visible |
This is the message body. |
| url |
visible |
Allows used that have a web site to have it referenced in
the message. |
| url_title |
visible |
The text that will appear as the link for a specified url |
| img |
visible |
The url to add an image the user wants to include in the message.
It will be displayed before any text, assuming the url is valid. |
| user* |
hidden |
Your user ID or username. This should be in the format of
user@ . |
| mesgfile* |
hidden |
Name of the mail message board file (i.e. wwwboard.html).
This tag defaults to index.html (for compatibility with older
web pages). We suggest defining this as wwwboard.html and keep
the name of the wwwboard.html file. |
| title* |
hidden |
The title to use in the individual message pages. You will
edit wwwboard.html to insert this web page's title, however,
the message pages use this tag to get their title. |
| show_faq |
hidden |
Set to 1 to show a link to the faq.html file,
set to 0 to leave this off the individual message pages. |
| allow_html |
hidden |
Set to 1 to permit HTML tags in the message body
and 0 to have them stripped. Basically, if this option is set
to 0, all data between any <> characters will be stripped
from the user's messages. |
| quote_text |
hidden |
Set to 1 to have the previous message quoted in
the message body automatically. Set to 0 to disable this feature. |
| Subject_line |
hidden |
Set to the following:
0 = User is presented with the subject of the previous message
which they can edit.
1 = Subject is copied from the previous message and cannot be
changed.
2 = An empty subject box is presented to the user. |
| use_time |
hidden |
Set to 1 to include the time in the message along
with the date. Set to 0 to not include the time. The default
is to not include the time. |
| path* |
hidden |
This field is required if you want to run more
than one message board. It defines the path in the wwwboard
directory where to find the web board files. Normally, in a
single message board situation, this tag is not used. |
Running multiple web message boards
In order to run multiple message boards, you will need multiple
directories. One directory per message board. The layout of the
directories has already been explained in Create
the required directories above.
In each board's directory, is a wwwboard directory. This is where
you would place the wwwboard files (wwwboard.html, wwwadmin.html,
etc..).

The only limit on the number of message boards you can create is
the disk space allotted to you.
Once the directory structure has been create, you must define the
path tag in your wwwboard.html and wwwadmin.html files to
the name of the top directory. In the example above, the path tag
would be defined as <input type=hidden name=path value="boardthree">
Web Message Board Tag Details
name
This is a visible tag and required tag that allows the user to
enter their real name. The user must supply a name for the message
to be posted.
Syntax: <input type=text name="name">
[ top ]
email
This is a visible tag that gives the user a place to enter their
email address. This is an option field and the user need not specify
their email address, should they desire not to.
Syntax: <input type=text name="email">
[ top ]
subject
This is a visible tag that allows the user to enter a subject for
their message. The user must supply a subject for the message to
be posted.
Syntax: <input type=text name="subject>
[ top ]
body
This is a visible tag that allows the user to enter the text of
their message. The user must supply some text for the message to
be posted. This tag is usually implemented as a text area.
Syntax: <textarea name="body"></textarea>
[ top ]
url
This is a visible tag that allows the user to enter their url or
home page reference. The url is not checked for validity.
Syntax: <input type=text name="url">
[ top ]
url_title
This is a visible tag that allows the user to enter a title for
their url. The text entered here will appear as a url entered in
the url tag. If this is empty, the url itself is used for the url
text.
Syntaxt: <input type=text name="url_title">
[ top ]
img
This is a visible tag that allows the user to enter a url to and
image they want posted along with their message. The image is shown
before any text of their message. The validity of the url is not
checked.
Syntaxt: <input type=text name="img">
[ top ]
user
This is a required tag. If this tag is missing, the search CGI
will present the user with an error. Specify your user
name for the user tag. This should be in the form of user@.
This tag is also used in the wwwadmin.html file.
Syntax: <input type=hidden name="user" value="foo@">
mesgfile
This tag is the name of the main message board file. This tag defaults
to index.html (for compatibility with older web pages). We suggest
defining this as wwwboard.html and keep the name of the wwwboard.html
file. This tag is also used in wwwadmin.html.
Syntax: <input type=text name="mesgfile" value="wwwboard.html">
[ top ]
title
This tag is used as the title of the individual messages. This
tag is also used in the wwwadmin.html file. The admin CGI script
uses it to provide a link back to your message board.
Syntax: <input type=text name="title" value="My
Message Board">
[ top ]
show_FAQ
This tag allows the display of the link to the FAQ. Set to 1 to
show the link, and to 0 to disable the link. The faq.html file MIST
be in the same directory as the wwwboard.html file for the link
to work.
Syntax:
To enable showing the FAQ link: <input type=hidden name="show_FAQ"
value="1">
To disable showing the FAQ link: <input type=hidden name="show_FAQ"
value="0">
[ top ]
allow_html
Normally, HTML tags are filtered from all form fields. However
, this tag allows you to disable this feature and allow HTML tags
in the message body All other tags are still filtered and the <blink>
tag is always removed. To allow HTML in the message body, set this
tag to 1. To not allow HTML tags, set this tag to 0 (or leave it
out).
Syntax:
To allow HTML tags: <input type=hidden name="allow_html"
value="1">
To disallow HTML tags: <input type=hidden name="allow_html"
value="0">
[ top ]
quote_text
This tag controls whether the text of the previous message will
appear in the message body automatically. This function is known
as quoting in a reply. Set this option to 1 to enable quoting. Set
this option to 0 to disable it.
Syntax:
To allow quoting: <input type=hidden name="quote_text"
value="1">
To disallow quoting: <input type=hidden name="quote_text"
value="0">
[ top ]
subject_line
This tag controls how the subject will be displayed in the follow-up
section of the individual message files. The tag supports options
0, 1, and 2.
| subject_line value |
Result |
| 0 |
The subject will be quoted from the previous message and the
user will be permitted to edit the subject. This is the default. |
| 1 |
The subject will be quoted from the previous message but the
user will not be permitted to change it |
| 2 |
The subject will be not be quoted from the previous message
and the user will be permitted to enter a new subject. |
Syntax:
<input type=hidden name="subject_line" value="0">
"value", above, should be set to either 0,1, or 2.
[ top ]
use_time
Each message is stamped with the date. Optionally, the time can
also be placed with the date. Set this tag to 1 to include the time
with the date in each individual message. Set to zero to disable
this feature. The default is to not include the time with the date.
Syntax:
To include the time: <input type=hidden name="use_time"
value="1">
To not include the time: <input type=hidden name="use_time"
value="0">
[ top ]
path
The path tag permits multiple message boards to exist in one web
site. This defines the path off the public_html directory where
the wwwboard directory exits. See Running
multiple web message boards for more details.
Syntax: <input type=hidden name="path" value="boardtwo">
[ top ]
|