Well im new to scripting and i attepmted to right a basic guest book that i am going to one day turn into a full blown forum. I was just wondering if any one can point out what i did wrong on this script. Please HELP!
#!/usr/bin/perl
use CGI;
my $cgi = CGI->new();
my $name = $cgi->param('name');
my $msg = $cgi->param('msg');
if (length ($name) > 50 || length ($msg) > 2000) {
print "Content-type: html/text\n\n";
print "Your name or message was too long.";
exit;
}
$msg =~ s/[\n\r]/<br>/g;
open (LOG, ">>msg_log.txt") || die ("Can't open msg_log.txt: $!");
flock (LOG);
print LOG "$name wrote: $msg\n";
close (LOG);
print "Content-type: html/text\n\n";
print "Thanks for your message";
exit;
I suck at de-buggin and cant seem to figure it out. so please help.