#!/usr/bin/perl -Tw ############################################################ ## 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; # declare variables my($forum, $sth, $rv, $id, $name, $desc); # untaint the query string if ($ENV{QUERY_STRING} =~ /^(\d+)$/) { $forum = $1; } else { &dienice("$ENV{QUERY_STRING} isn't a valid forum number."); } # get the forum info $sth = $dbh->prepare("select * from forums where id=?"); $rv = $sth->execute($forum); my($f) = $sth->fetchrow_hashref; &do_header("New Topic in $f->{name}"); print <
Your Name:     
Email Address: 
Subject:       
Enter your message below. Do not use HTML tags.

EndForm &do_footer;