Hi I have made an html form that forces a user to fill out certain fields including where to email the contents of the form and allows them to upload a file.
an email is then delivered with all the form fields and contents along with a link to the file. We are beginning to send ad proofs to customers using this site. It all works but I don't like the look of the email that is delivered. Even when the customer does not fill out optional fields, the fields with empty content is displayed. I don't know how to change this. I only want the fields that the customer has filled with data to be displayed. In other words ... 'do_not_print_blanks' I am sure that this is a simple affair but I just don't know the proper syntax. here is the part of the cgi script that parses the form and prints the info: sub CollectUserFormInput { use CGI qw(:standard); $CGI::OS = 'WINDOWS' if ($Windows); $CGI::POST_MAX=1024 * 20000; # max 20MB posts $query = new CGI; $email_addresses = $query->param('cust_email'); $filename = $query->param('UploadedFile'); $filename =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg } # --------------------------------------------------------------------- sub Process_File { if ($fileName =~ /[\W+\.]/) { #if ($filename =~ /\//) { @array = split(/\//, $filename); $real_name = pop(@array); } elsif ($filename =~ /\\/) { @array = split(/\\/, $filename); $real_name = pop(@array); } else { $real_name = "$filename"; } chop($real_name) while (length($real_name) > 25); $real_name =~ s/://g; $real_name =~ s/%20//g; $real_name =~ s/%2F/-/g; $real_name =~ s/ //g; $outfile = "$path" . "/" ."$real_name"; $outfile =~ s/://g; $outfile =~ s/%20//g; $outfile =~ s/%2F/-/g; $outfile =~ s/ //g; $filename = $query->param('UploadedFile'); &DuplicateFile if ((-e "$outfile") && (!$overwrite)); if (!open(OUTFILE, ">$outfile")) { print "Location: $error_url\n\n\n"; exit 0; } while ($bytesread = read($filename,$buffer,4096)) { $totalbytes += $bytesread; binmode OUTFILE; print OUTFILE $buffer; } close($filename); close(OUTFILE); if ((stat $outfile)[7] < 1) { unlink $outfile; &FileSizeIsNil; } chmod (0644, "$outfile") if (!$Windows); chown ($userid, $groupid, "$outfile") if (!$Windows); } # --------------------------------------------------------------------- sub Save_Text { my($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst); ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time); my($stamp); #remember to change the next line to 2000 after the first $stamp = sprintf("%04d-%02d-%02d @ %02d:%02d:%02d",1900 + $year, $mon+1, $mday, $hour, $min, $sec); $descrip = $real_name . '.txt'; $descrip =~ s/://g; $descrip =~ s/%2F/-/g; open (OUT, ">../CreativeProofs/" . "uploads/" . "$descrip") || die; print OUT ("=================================================================\n"); print OUT (" Notice of Digital Proofs - File Information\n"); print OUT ("================================================================\n"); print OUT ("\nCustomer Name: "); print OUT $query->param('CustName'); print OUT ("\n "); print OUT ("\nJob Description or Ad Number: "); print OUT $query->param('JobDesc'); print OUT ("\n "); print OUT ("\nPublication Date: "); print OUT $query->param('Pubdate'); print OUT ("\n "); ect., ect, ect., all the way thru the form until all the contents and fields are accounted for. I'd like it to NOT print out the field if the field is empy. Thanks in advance -- Debbie McNerney, Systems Dept. The News-Journal Corp.® 901 6th Street Daytona Beach, Florida 32117 386-252-1511 ext. 2314 [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]