Latest guestbook++

This commit is contained in:
swaggboi 2021-05-02 19:32:36 -04:00
parent 164258d02a
commit e62fce85fd

View File

@ -19,9 +19,8 @@ use WebService::Mattermost;
# Create CGI object (query)
my $q = CGI->new();
# Open banned phrases file
# Open banned phrases and users files
open(my $thoughtCrimes, '.msg.bans') or die "$@";
# Open banned users file
open(my $nameBans, '.name.bans') or die "$@";
# Get creds file
@ -127,9 +126,11 @@ sub params_in {
# Enforce max length for params
if (length($name) < 1 || (length($name) >= 40)) {
die "Name field must be between 1 and 40 characters\n"
} elsif (length($location) < 1 || length($location) >= 40) {
}
elsif (length($location) < 1 || length($location) >= 40) {
die "Location field must be between 1 and 40 characters\n"
} elsif (length($message) < 1 || length($message) >= 1900) {
}
elsif (length($message) < 1 || length($message) >= 1900) {
die "Message field must be between 1 and 1900 characters\n"
}
@ -194,6 +195,7 @@ print $q->header(-charset => 'UTF-8');
# Print the head & title, begin the body
print $q->start_html(
-dtd => 'html',
-title => 'SwaggNet Guestbook',
-style => '/css/swagg.css'
);
@ -207,7 +209,7 @@ print $q->div(
) . "\n";
# Process returned params if present; else print form
($q->param()) ? params_in() : form_out();
$q->param() ? params_in() : form_out();
# Print link to go back to homepage in footer
print $q->div(