Create a file and call it myblog.html. It should just have html and body tags. Save it in the cgi bin. This is the file that will be written to. Then create the following HTML and perl files. Save them in the cgi bin also.

Html Code


Blog Writer
<html>
<body>
<form method ="Post" action = "blogwrite.pl">
<TEXTAREA name="comments" cols=30 rows=15>
</TEXTAREA>
<INPUT TYPE="reset">
<INPUT TYPE="submit" NAME="submit" VALUE="Submit">
</FORM>


Perl Code to Append or Create a Blog File


#!/usr/local/bin/perl
use CGI qw(param);
print "Content-type : text/html\n\n";
$n = param('comments');
open (blog,">>myblog.html") || die("Could not open file");

# use Perl local time function

$datetime = localtime();
print blog $datetime;

print blog ("<u>");
print blog ($todays_date);
print blog ("</u>");
print blog ("<br>");
print blog ("<br>");
print blog ($n);
print blog ("<br>");
print blog ("<br>");
print blog ("<hr>");
print blog ("<br>");
print blog ("<br>");
close (blog);
print "<html>";
print "<body>";
print "<a href ='http://freewebs.com/myname'>Click to Return</a>";
print "</body>";
print "</html>";