The bugreport.pl Perl script


#*********************************************************
#	      Script for getting bug reports
#*********************************************************
# define the bug file
$bugs = "../htdocs/bugs.shtml";

#Call in the CGI library.
require "cgi-lib.pl";
if (&MethGet) {
	# under GET return form.
	&ReturnForm;
} else {
# Under POST, process the report.
	&WriteReport
}

#*********************************************************
#		ReturnForm Subroutine
#*********************************************************
sub ReturnForm {
	print "Content-type: text/html\r\n\r\n";
        print "<HEAD>\n";
	print "<TITLE>Bug report</TITLE>\n";
	print "</HEAD>\n";
	print "<BODY bgcolor=\"#ffffff\">\n";
	print "<center><h1>Submit a bug or suggestion</h1></center>\n";
	print "<hr>\n";
	print "<FORM METHOD=\"POST\" ACTION=\"/cgi-shl/bugreport.pl\">\n";
	print "<P>\n";
	print "Please, enter your name:\n";
	print "<INPUT TYPE=\"text\" NAME=\"username\" SIZE= 45>\n";
	print "<P>\n";
	print "and your e-mail address:\n";
	print "<INPUT TYPE=\"text\" NAME=\"email\" SIZE= 45>\n";
	print "<P>\n";
	print "Select the severity of the bug (1=not serious, 5=very serious):\n";
	print "<P>\n";
	print " 1 <INPUT TYPE=\"radio\" NAME=\"severity\" VALUE=\"1\" CHECKED> \n";
	print " 2 <INPUT TYPE=\"radio\" NAME=\"severity\" VALUE=\"2\" > \n";
	print " 3 <INPUT TYPE=\"radio\" NAME=\"severity\" VALUE=\"3\" > \n";
	print " 4 <INPUT TYPE=\"radio\" NAME=\"severity\" VALUE=\"4\" > \n";
	print " 5 <INPUT TYPE=\"radio\" NAME=\"severity\" VALUE=\"5\" > \n";
	print "<P>\n";
	print "<center>Please describe the bug or suggestion: \n";
	print "<br>\n";
	print " <TEXTAREA NAME=\"bugtext\" ROWS=\"10\" COLS=\"80\"></TEXTAREA> \n";
	print "<p>\n";
	print " <INPUT TYPE=\"submit\" VALUE=\"Submit bug or suggestion\"> \n";
	print " <INPUT TYPE=\"reset\" VALUE=\"Start again\"> \n";
        print "<P>Thank you!</center> \n";
        print "<P>\n";
	print "</BODY></HTML>\n";
}

#*********************************************************
#		WriteReport Subroutine
#*********************************************************

sub WriteReport {
	# Open the report file
	open (REPORT,">>" . $bugs) || die "Could not open the bugs file \n";
	# Parse the form pairs into %in, @in, $in
	&ReadParse;
	# Write the bug report
	print REPORT "<P> \n";
	print REPORT "Bug severity: $in{severity} \n"; 
	print REPORT "<P> \n";
	print REPORT " <center> $in{bugtext} </center>\n";
	print REPORT "<P> \n";
	print REPORT "Submitted by $in{username}, $in{email} \n";
	print REPORT "<HR> \n";
	close REPORT;
	# Send acknowledgement back
	print "Content-type: text/html\r\n\r\n";
	print "<TITLE>Bug or suggestion submitted</TITLE> \n";
	print "<BODY bgcolor=\"#ffffff\">\n";
	print "<P>\n";
	print "<center><h1>Thanks $in{username} </h1>\n";
	print "<P>\n";
	print "<h3>Your suggestion or bug report regarding Pebble is much welcome!</h3>\n";
	print "<P>\n";
	print "You can see <a href=\"/bugs.shtml\">here</a> the bugs and suggestions received.</center> \n";
	print "<P>\n";
	print "</BODY></HTML>\n";
}


This page is maintained by Al Bento who can be reached at abento@ubmail.ubalt.edu. This page was last updated on April 17, 1996. Although we will attempt to keep this information accurate, we can not guarantee the accuracy of the information provided.