#!/usr/bin/perl $mailprog = '/usr/lib/sendmail'; @referers = ('www.co.san-diego.ca.us','63.200.213.56', 'www.rad.co.san-diego.ca.us','63.200.213.30'); ############################################################################## # Retrieve Date &get_date; # Send E-Mail &send_mail; # Return HTML Page or Redirect User &return_html; sub get_date { # Define arrays for the day of the week and month of the year. # @days = ('Sunday','Monday','Tuesday','Wednesday', 'Thursday','Friday','Saturday'); @months = ('January','February','March','April','May','June','July', 'August','September','October','November','December'); # Get the current time and format the hour, minutes and seconds. Add # # 1900 to the year to get the full 4 digit year. # ($sec,$min,$hour,$mday,$mon,$year,$wday) = (localtime(time))[0,1,2,3,4,5,6]; $time = sprintf("%02d:%02d:%02d",$hour,$min,$sec); $year += 1900; # Format the date. # $date = "$days[$wday], $months[$mon] $mday, $year at $time"; } sub return_html { print "Location: $redirect \n\n"; } sub send_mail { #Determine form source if ($formsource eq 'webpoll'){ # Localize variables used in this subroutine. # # Open The Mail Program SG081797 MODIFICATION - USE: mail open(MAIL,"|mail $recipient") || die ; print MAIL "To: $recipient \n"; print MAIL "From: $realname \n"; # Write Email print MAIL "Subject: $subject \n\n"; print MAIL "Below is the result of the Web Poll for Regional Governace. \n"; print MAIL " Which District do you live in: $q1 \n"; print MAIL " Is the regional strategy for growth headed in the right direction: $q2 \n"; print MAIL " How Satisfied are you with the current regional governance (SANDAG): $q3 \n"; print MAIL " Do you believe a new regional structure of government is needed: $q4 \n"; print MAIL " Rate the following based on the priority you think local government should place on each issue: \n"; print MAIL " Airport: $q5_1 \n"; print MAIL " Beaches: $q5_2 \n"; print MAIL " Funding for roads: $q5_3 \n"; print MAIL " Funding for services: $q5_4 \n"; print MAIL " Land Use Authority: $q5_5 \n"; print MAIL " Regional cooperation: $q5_6 \n"; print MAIL " Waterways: $q5_7 \n"; print MAIL " Do you believe that the Metropolitan Transit District Board (MTBD) and North County Transit District (NCTD) serve their respective jurisdictions effectively: $q6 \n"; print MAIL " Should the following be included into a regional government: \n"; print MAIL " Airport: $q7_1 \n"; print MAIL " Conservation: $q7_2 \n"; print MAIL " Land Use Athority: $q7_3 \n"; print MAIL " Ports: $q7_4 \n"; print MAIL " Transportation: $q7_5 \n"; print MAIL " Water: $q7_6 \n"; } close (MAIL); }