#!/usr/bin/perl -wT
############################################################
## Written and copyright 2002 by
## Jacqueline D. Hamilton (kira@cgi101.com)
##
## This code is excerpted from "CGI Programming 201"
## (http://www.cgi101.com/advanced)
##
## You may use this code on your own website, however
## you may not publish or sell any copy or derivative work
## without permission of the author.
#############################################################
use strict;
use lib '../';
use MyBoard;
&do_header("Edit Forum");
my($forum, $f, $i);
if ($ENV{QUERY_STRING} !~ /^(\d+)$/) {
&dienice("$ENV{QUERY_STRING} isn't a valid forum number.");
} else {
$forum = $1;
}
my($sth) = $dbh->prepare("select * from forums where id=?");
my($rv) = $sth->execute($forum);
$f = $sth->fetchrow_hashref;
# just in case someone put quotes in these, escape them so
# they don't break the form
$f->{name} =~ s/\"/\"/g;
$f->{description} =~ s/\"/\"/g;
my($ranks) = "";
foreach $i (1..5) {
if ($f->{rank} == $i) {
$ranks .= "