#!/usr/local/bin/perl -w #============================================================================ # Copyright 1999 Mikodocs Guide to HTML, http://www.mikodocs.com/ # You may distribute this program freely, but keep # this notice in place. #============================================================================ #============================================================================ # modules # use strict; use CGI; use CGI::Carp 'fatalsToBrowser', 'croak'; $CGI::POST_MAX = 10240; # set maximum size of post # # modules #============================================================================ #============================================================================ # variables # my ( $query, # CGI query object $maxFields, # maximum number of fields to accept $rand, # random number for banners $paramKey, # a single parameter name $inputdata, # filehandle for uploaded files @inputVals, # values for a field (they can send more than one) $inputVal, # a single values for a field $modval, # modified value of $fileinfo, # uploaded file information @params, # array of all fields sent $key,$val, # key an value for $fileinfo hash ); $query=CGI->new; # get CGI object $maxFields=30; # maximum number of fields to accept $rand = int(rand(100000)); # random number for ad banner # # variables #============================================================================ #============================================================================ # top of page # print $query->header; print <<"(TOPOFPAGE)";
", tablesc($paramKey), " | "; # name of field print "
| ", tablesc($paramKey), " | "; #out put value(s) for field foreach $inputVal (@inputVals) {$inputVal = tablesc($inputVal)} print join(" | ||||||
---|---|---|---|---|---|---|---|---|---|
",@inputVals), " | ";
}
#
# value
#----------------------------------------------------------------
print "
\n" if @params; # # list #============================================================================ #============================================================================ # bottom of document # # ************************************************************************ # *** IF YOU COPY My CGI, ABSOLUTELY PLEASE DO NOT CHANGE THIS SECTION *** # ************************************************************************ print <<"(END BOTTOM OF PAGE)";
(END BOTTOM OF PAGE) # # bottom of document #============================================================================ #============================================================================ # tablesc # return undefined or for space-only/empty string, # otherwise change < > and & to character entities # sub tablesc { return " " if (! defined $_[0]) || ($_[0] !~ m|\S|); $_[0] =~ s|&|&|gso; $_[0] =~ s|<|<|gso; $_[0] =~ s|>|>|gso; $_[0]; } # # tablesc #============================================================================