#!/usr/local/bin/perl #### # # Program: question1.pl # Cimmaron Design # 702 448-4927 # #### #### # # Image Uploading Routine # #### #### # # The libraries to use... CGI for the CGI functions used in print statements. # Use 'perldoc CGI' to find out more about the CGI functions. # #### use CGI qw/:all/; #### # # Begin of the main code # #### #### # # The param function will determine if there was a CGI submission. # #### if (param) { #### # # This is where we want to be, print out a nice HTML header # and start to process the stuff that the server will send in # email to the user and the guys who are going to actually # fill the order. # #### print STDOUT header; print STDOUT start_html('View Sovereign Questionnaire'); #### # # Okay - next we will verify *all* the fields on the order # form are listed properly, and verify their correctness. # If those conditions are met, then we'll print out what the # email will look like, and save it off to a variable that we # can pipe to the email program. # #### $your_email_address = param('your_email_address'); $your_name = param('your_name'); $email_subject_line = param('email_subject_line'); $required_fields = param('required_fields'); $thank_you_title = param('thank_you_title'); $return_link_url = param('return_link_url'); $return_link_name = param('return_link_name'); $client_email = param('client_email'); $client_name = param('client_name'); $client_phone = param('client_phone'); $tell = param('tell'); $owned = param('owned'); $lookingfor = param('lookingfor'); $how = param('how'); $fenced = param('fenced'); $time = param('time'); $sex = param('sex'); $house = param('house'); $out = param('out'); $comp = param('comp'); $comments = param('comments'); #### # # Now - to verify each of the *required* entries... the # undefined ones weren't used in what the user listed... # We'll go through all the errors, and then print out what # we find, instead of breaking if there's just one and not # showing any others we might find as well, to make it more # usable. # #### $err_no = 0; if ( ! defined($your_email_address) ) { $err[$err_no++]="Invalid hidden fields 'your_email_address'\n"; } if ( ! defined($your_name) ) { $err[$err_no++]="Invalid hidden fields 'your_name'\n"; } if ( ! defined($email_subject_line) ) { $err[$err_no++]="Invalid hidden fields 'email_subject_line'\n"; } if ( ! defined($thank_you_title) ) { $err[$err_no++]="Invalid hidden fields 'thank_you_title'\n"; } if ( ! defined($return_link_url) ) { $err[$err_no++]="Invalid hidden fields 'return_link_url'\n"; } if ( ! defined($return_link_name) ) { $err[$err_no++]="Invalid hidden fields 'return_link_name'\n"; } #### # # User information next... # #### if ( ! defined($client_email) ) { $err[$err_no++]="You must enter an email address\n"; } else { if ( $client_email eq "" ) { $err[$err_no++]="You must enter an email address\n"; } } if ( ! defined($client_name) ) { $err[$err_no++]="You must enter a name\n"; } else { if ( $client_name eq "" ) { $err[$err_no++]="You must enter a name\n"; } } if ( ! defined($client_phone) ) { $err[$err_no++]="You must enter a phone number\n"; } else { if ( $client_name eq "" ) { $err[$err_no++]="You must enter a phone number\n"; } } #### # # Verifications complete. Next we check if there were # any errors. If there were, print them, and exit, if not, # then print out what we're here after - the order form. # #### if ( $err_no > 0 ) { print STDOUT h2({-align=>'center'}, font( {-color=>"#AF0000"}, "Submitted Questionnaire - Sovereign Brittanys - errors" ) ), "\n"; print STDOUT hr( {-noshade} ), "\n"; print STDOUT "
\n";
if ($imageError) {
my @vars = sort(keys(%ENV));
#foreach(@vars) {
# $ENV{$_} ||= qq~›~;
#print qq~
#
# $of\$ENV{$_}$cf
# $of$ENV{$_}$cf
#
#~;
#}
print STDOUT " Upload Error: $returned\n";
}
print STDOUT "Email Address: $client_email\n";
print STDOUT "Your Name: $client_name\n";
print STDOUT "Your Phone: $client_phone\n";
print STDOUT "___________________________________________________________________________\n";
if ( length($tell) > 1 ) {
print STDOUT "Please tell us a little about your home and family (including number of children and ages at home). \n";
print STDOUT "$tell\n";
print STDOUT "___________________________________________________________________________\n";
}
if ( length($owned) > 1 ) {
print STDOUT "Have you owned a dog/Brittany (raised a puppy)? \n";
print STDOUT "$owned\n";
print STDOUT "___________________________________________________________________________\n";
}
if ( length($lookingfor) > 1 ) {
print STDOUT "What are you looking for in a Brittany? \n";
print STDOUT "$lookingfor\n";
print STDOUT "___________________________________________________________________________\n";
}
if ( length($how) > 1 ) {
print STDOUT "If you are looking for a hunting dog, how often do you hunt?
Will you be using a professional trainer? \n";
print STDOUT "$how\n";
print STDOUT "___________________________________________________________________________\n";
}
if ( length($fenced) > 1 ) {
print STDOUT "Do you have a fenced in yard? \n";
print STDOUT "$fenced\n";
print STDOUT "___________________________________________________________________________\n";
}
if ( length($sex) > 1 ) {
print STDOUT "Are you looking for a male or female, or open to either? \n";
print STDOUT "$sex\n";
print STDOUT "___________________________________________________________________________\n";
}
if ( length($house) > 1 ) {
print STDOUT "Where will this puppy/dog live? Where will it stay when you are not home? \n";
print STDOUT "$house\n";
print STDOUT "___________________________________________________________________________\n";
}
if ( length($out) > 1 ) {
print STDOUT "Will there be someone home during the day to take the puppy out? \n";
print STDOUT "$out\n";
print STDOUT "___________________________________________________________________________\n";
}
if ( length($comp) > 1 ) {
print STDOUT "Do you have any interest in competing with your dog
(ie. conformation shows, hunt tests, field trials, agility,
obedience, rally, lure coursing, barn hunt, etc)? \n";
print STDOUT "$comp\n";
print STDOUT "___________________________________________________________________________\n";
}
if ( length($comments) > 1 ) {
print STDOUT "Additional Comments:\n";
print STDOUT "$comments\n";
}
print STDOUT "\n";
print STDOUT "