#!/usr/bin/perl -w # Copyright (C) 2002/2003 Kai Seidler, oswald@apachefriends.org # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. use CGI; $form=new CGI; $f_from=CGI::escapeHTML($form->param("f_from")); $f_to=CGI::escapeHTML($form->param("f_to")); $f_text=CGI::escapeHTML($form->param("f_text")); print "Content-Type: text/html\n\n"; if($f_from) { open (FILE, ">>guestbook2.dat") or die ("Cannot open guestbook2 file"); print FILE localtime()."\n"; print FILE "$f_from\n"; print FILE "$f_to\n"; print FILE "$f_text\n"; print FILE " \n"; close(FILE); } print ''; print ''; print ''; print ''; print ''; print ''; print ' 

'; print "

Guest Book (Example for Perl)

"; print "A classic and simple guest book!"; open (FILE, "); chomp($name=); chomp($email=); print "

$date"; print ""; print ""; print ""; print "
"; print "
"; print "From: $name"; print "
"; print "
"; print "To: $email"; print "
"; while(1==1){ chomp($line=); if($line eq '.') { last; } print "$line
"; } print "
"; } close (FILE); print "

Add entry:"; print "

"; print ""; print ""; print ""; print ""; print ""; print "
From:
To:
Text:
"; print "
"; print ""; print "";