|
Kaye and Geoff's web page documentation
The CGI to write to the guestbook with acknowledgementThe guestbook is made up of three files containing HTML code - a header, a body which has the entries, and a footer. This structure means that this script can just append to the body file without having to carry out complex insertions. A more sophisticated guestbook might allow the owner to delete arbitary records and and archive old records; in practice it will also be necessary to check for antisocial entries of various sorts, for example rude or abusive words and HTML code which may include active links or scripts.
'; } ($value = $value) =~ s/\s/ /g; if ($var eq "name") { $name = $value; } if ($var eq "country") { $country = $value; } if ($var eq "org") { $org = $value; } if ($var eq "comments") { $comments = $value; } } # # append this record to the guestbook # each record is one row in an HTML table # if (open (LOG, ">>guestbook")) { print LOG " $date<\/td>";
print LOG " | $name<\/td>";
print LOG " | $country<\/td>";
print LOG " | $org<\/td>";
print LOG " | $comments<\/td><\/tr> \n";
close (LOG);
}
#
# display a confirmation page
#
print "Content-type: text/html\n\n";
print ' |
Thank you for adding your comments to our guestbook'; print ' Your comments have been noted'; print "\n"; print ' '; print "\n"; print ''; exit;
Top |
Close |