Creating a simple CGI message board
The HTML Templates
The Bulletin Board Script
Displaying the Message List
Displaying Messages
Adding New Messages
Adding Replies
Expiring Messages
The Complete Bulletin Board Script
Creating a simple CGI message board
For this example, you set up a bulletin board where users can post messages about movies. Each message will contain fields for the user's name, e-mail address, message subject, message date, and message contents. So the bulletin board is easy to read and navigate, the user will only see two kinds of pages: a Web page that lists all the messages that have been posted and a Web page that displays one of the messages from the bulletin board.
To reduce the number of HTML tags you need in your bulletin board CGI, you will create HTML template files that hold most of the HTML code for your Web bulletin board pages. An HTML template file is just a file containing text and HTML tags. It is a template file because it is not directly displayed to the user. Instead, your bulletin board CGI script reads in the contents of the template file, makes some changes, and then returns the altered contents to the user's Web browser. Your bulletin board script only requires two template files, one for displaying the headers from all the messages and one for displaying an entire message.