#!/usr/bin/perl -w -- -*- C -*- # Modified from a file by Henrik Delin september 95. require "cgi-lib.pl"; MAIN: { $book="Ediskkommentarer.html"; $form="Kommentarform.html"; # Read in all the variables set by the form if (&ReadParse(*input)) { &ProcessForm; } else { &PrintForm; } } sub ProcessForm { # Start processing and saving data $dator = $ENV{'REMOTE_HOST'}; $tid = `date '+Klockan %T den %d %h %Y'`; $tid =~ s/May/Maj/g; $tid =~ s/Oct/Okt/g; # Add the form result to the book. open(BOOK,">>$book"); print BOOK < $tid, $dator:
$input{'text'}
- $input{'namn'} ($input{'email'})
ENDOF close BOOK; # Print the header print &PrintHeader; #print <<`EOC`; # cat $book; #EOC print"
"; print " "; open(FIL,"$form"); while () { print; } close(FIL); # open(FIL,"log_foot.html"); # while () { # print; # } # close(FIL); } sub PrintForm { print &PrintHeader; open(FIL,"$form"); while () { print; } close(FIL); # print "
"; # # open(FIL,"$book"); # while () { # print; # } # close(FIL); # # print""; # # open(FIL,"log_foot.html"); # while () { # print; # } # close(FIL); }