#!"E:\nuevo\perl\bin\perl.exe" # 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; use File::Basename; $gb = dirname("$0")."/guestbook.dat"; $form = new CGI; $f_name = CGI::escapeHTML($form->param("f_name")); $f_email = CGI::escapeHTML($form->param("f_email")); $f_text = CGI::escapeHTML($form->param("f_text")); print "Content-Type: text/html; charset=iso-8859-1\n\n"; if ($f_name) { open(FILE, ">>$gb") or die("kon bestand gastenboek niet openen"); print FILE localtime()."\n"; print FILE "$f_name\n"; print FILE "$f_email\n"; print FILE "$f_text\n"; print FILE "·\n"; close(FILE); } print ''; print ''; print ''; print ''; print ''; print 'Gastenboek (Voorbeeld voor Perl)'; print ''; print ''; print "

Gastenboek (Voorbeeld voor Perl)

"; print "

Een klassiek en simpel gastenboek!

"; open(FILE, "<$gb") or die("kon bestand gastenboek niet openen"); while (!eof(FILE)) { chomp($date = ); chomp($name = ); chomp($email = ); print "
$date
"; print ""; print ""; print ""; print "
"; print "
"; print "Naam: ".CGI::escapeHTML($name); print "
"; print "
"; print "E-Mail: ".CGI::escapeHTML($email); print "
"; while (1 == 1){ chomp($line = ); if ($line eq '·') { last; } print CGI::escapeHTML($line)."
"; } print "
"; print "
"; } close(FILE); print "

Voeg entry toe:

"; print "
"; print ""; print ""; print ""; print ""; print ""; print "
Naam:
E-Mail:
Tekst:
"; print "
"; print ""; print "";