Due Date: October 11, 2000
(1) Write a CGI Perl program that can be used as a part of a Web-based message board application. The program, preview.pl, initially presents a form, which will be submitted to itself:
The form allows user to post messages. The user may select to post their comments as HTML or plain text. The list of acceptable HTML tags supported are listed within the form. The form also has the Preview and Submit buttons.
For example, if the user previews the comments in the above form by posting with HTML, the following two screens show the output. Study carefully to make sure your program correctly handles the comments by providing the exact output.
Scrolling down the screen above to get the screen below. Note that HTML is pre-selected.
On the other hand, the user may select to preview by posting with plain text:
The following two output screens may be obtained. Note that plain text is pre-selected as the subsequent "posted as."
If the submit button is clicked instead, the following two screens show the output for HTML and plain text options respectively. Note the difference in background color and the addition of time.
Your program does not need to actually save the messages.
The input used for comments in testing is:
My equation: 3<5, 6<7, 8 < 9 are
true.<hr>
<ul>My favorite food:
<li>Ice Cream <li>Chocolate
<li>Banana split
</ul>
<pre>
One line
Two lines
</pre>
For <u>reference</u>, go to <a href="abc.html">here</a>.
An <funny> <tag/>: <img src="abc.jpg"><br>
<center>Good work!</center>
<ok><b>bye</b></ok>.