#!/usr/bin/perl ## ~wn/fst/fback.cgi # # This is a CGI script which lets WWW users send us feedback using a HTML # form. If the CGI PATH_INFO passed to us is empty, then we just return # a HTML document with a form allowing the user to post feedback. If the # CGI PATH_INFO is set to /post, the user's feedback is emailed. # Original written by Ron Pool modified by Z (1/26/95). # Program that sends email. $mailer = '/usr/lib/sendmail'; # Who gets feedback. $feedback_addr = "mm95\@cornell.edu"; # URL for this script (without arguments) on this server. $me = "eval.cgi"; $d = "The time is now ". `date`; # Get the argument from the URL. $pathinfo = $ENV{PATH_INFO}; # Start out by sending a content-type for the document we'll be returning. print < Feedback Form

Evaluation Form for SARE Modules

 

Please tell us a little about yourself:

I'm a . . .

Farmer
Crop advisor
Industry Representative
Other, please state:

 

My commodity area is . . .

Dairy and Field Crops
Vegetables
Fruits and berries
Greenhouse and nursery stock
Other, please state:

 

Let us know what you think:

What part of the workshop was most interesting for you?

What part of the workshop was most valuable to you?

What 2 new ideas would you like to try on your farm or in your business?

Do you feel you understand IPM-and how to use it-better now?

What other information should be included in this module?

What other topics would you like us to cover in future modules?


EOF } # post_feedback; Post the feedback by email and thank the submitter. sub post_feedback { # Get the input. read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); # Split the name-value pairs. @pairs = split(/&/, $buffer); foreach $pair (@pairs) { ($name, $value) = split(/=/, $pair); # Un-Webify plus signs and %-encoding $value =~ tr/+/ /; $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; # Stop people from using subshells to execute commands # Not a big deal when using sendmail, but very important # when using UCB mail (aka mailx). $value =~ s/~!/ ~!/g; # Uncomment for debugging purposes # print "Setting $name to $value

"; $form{$name} = $value; } # If the comments are blank, then give a "blank form" response. # if (! $form{'comments'}) { # print <Comments not sent # #

Comments not sent

#Your comments seem to be blank, so I didn't send them. #Please re-enter your comments. # # #EOF # exit 0; #} # Now send mail to $feedback_addr open(MAIL, "|$mailer $feedback_addr") || &punt("Can't open $mailer!"); print MAIL <Thank you!

Thank you

Thanks for giving feedback!

Back to the Northeast Regional Teaching Modules EOF } # &punt($message); Returns an error document with the specified $message # in it and then exits the script. sub punt { local($message) = @_; print <500 $message

Error code 500

$message EOF exit 1; }