#!/usr/bin/perl # # postguestbook.pl v0.0.5 - Submit data to guestbook # Copyright (C) 2009, 2010, 2011 Stian Skjæveland # # This program is free software; you can redistribute it and/or # modify it under the same terms as Perl itself. # use CGI qw(:standard); use strict; print header; print qq( Data submited to guestbook

Data submited to guestbook


); my $param_name=param('name'); my $param_message=param('message'); my $param_keyword=param('keyword'); my $date=`date`; chomp($date); my $file="/home/stunix/domains/atlantiscrew.net/public_html/stian/doc/guestbook.txt"; my @filelines; print "You have entered the following data: $param_name\n$param_message\n"; print "

Back to previous page."; if (!($param_name)) { print "

ERROR: You need yo add your name!"; } if (!($param_message)) { print "

ERROR: You need yo add your message!"; } if (!($param_keyword)) { print "

ERROR: You need yo add your keyword!"; } if ($param_keyword ne "fifty") { print "

ERROR: Wrong keyword! DID YOU TYPE WITH LOWERCASE CHARACTERS IN ENGLISH?

"; exit(0); } if ($param_name && $param_message && $param_keyword) { open(GUESTBOOK, ">>$file") || print "error: $!"; @filelines=; print GUESTBOOK "$param_name/$date/$param_message\n"; close(GUESTBOOK); } print qq(


Copyright (C) 2009, 2010, 2011 Stian Skjæveland.
Verbatim copying and redistribution of this entire page are permitted provided this notice is preserved.

Poweredby Perl Valid HTML 4.01! Valid CSS! );