#!/usr/local/bin/perl $thisdir="/www/faculty/copper/2001/INPUT"; $mainpageURL="/faculty/copper/2001/"; $addmesgfile = "addmesg2001.html"; $readmesgfile = "readmesg2001.cgi"; $workingdir=$thisdir; $mesgdir="$thisdir/messages"; @VarNames=(); %VarValues=(); # the month and year you started the bulletin board $startyear = 2000; # <------ update $startmonth = 9; # <------ update chdir($workingdir); # how the background and colors should look $bodystmt = 'bgcolor="#009ebe"'; # the title of all outputted pages $title="Bulletin Board for Copper Mountain Conference"; @months=("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"); @months=("January","February","March","April","May","June", "July","August","September","October","November","December"); ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime; $year += 1900; print "Content-type: text/html\n\n"; print "\n"; print "\n
\nPlease fill out the form below to choose which messages\n"; print "you would like to scan.
\n"; print "
Post a message to the bulletin board.
Return to main page EOR exit 0; } # this will get the url-encoded data string (all the stuff the # user-entered into netscape) and put it in variable called $buffer if ($ENV{"REQUEST_METHOD"} eq "POST") { read (STDIN,$buffer,$ENV{"CONTENT_LENGTH"}); } else { $buffer=$ENV{"QUERY_STRING"}; } # decode it and put stuff in array VarValues and hashtable VarValues &DecodeUrl($buffer); # give 'em easier to type names @names = @VarNames; %values = %VarValues; # we don't need all that memory anymore @VarNames=(); %VarValues=(); # get the month and year from the url-encoded string ($m,$y)= split(/:/,$values{"month"}); # start the html code print "
\n"; # bad month # 1. $m is not "all" and it's not a number # 2. $m is a number but the year is not a number # 3. $m is a number but it's larger than 12 or less than 1 if ( (($m !~ /^all$/) && ($m !~ /^\d+$/)) || (($m =~ /^\d+/) && ($y !~ /^\d+/)) || (($m =~ /^\d+$/) &&($m > 12 || $m < 1)) ) { print "\n"; print "Try using the offical search page\n"; print "
\n"; print "Post a message to the\n"; print "bulleting board.\n