#!/usr/bin/perl -w use Fcntl qw(:flock); use CGI qw(:all); use CGI::Carp qw(fatalsToBrowser); use strict; print header; #If statement that controls #the script. if (! param) { pageone(); } elsif (defined param('pagetwo')) { pagetwo(); } elsif (defined param('pagethree')) { pagethree(); } elsif (defined param('pagefour')) { pageone(); } else { pagefive(); #send_mail(); } #Load's first page #Users enter URL's sub pageone { my $link1=param("link1b"); my $link2=param("link2b"); my $link3=param("link3b"); my $link4=param("link4b"); my $link5=param("link5b"); print< Tornado Interactive: Let us maintain your site!
Welcome to our Maintenance page! Here you can enter up to Five links to Web Pages in your Web Site(s). If you need more than five pages to be maintained, please fill out our Support and Orders form. After you have finished filling in the URL's (Addresses) to your Web Pages, click the "Continue" button. On the next page you will be asked to verify the links you have submited. Please remember that this is simply a form for an estimate. You are not purchasing any maintenance at this time. Thank you.
http://
http://
http://
http://
http://

PAGE_ONE } #Load's Second Page #Displays URL's for confirmation sub pagetwo { my $link1=param("linkOne"); my $link2=param("linkTwo"); my $link3=param("linkThree"); my $link4=param("linkFour"); my $link5=param("linkFive"); my $addLinks=length($link1)+length($link2)+length($link3)+length($link4)+length($link5); if ($addLinks>3) { print< Tornado Interactive: Confirm Your Order!
Please check over the links you have submitted to ensure that they are correct. Clicking the link will open the page in a new window. Please verify that each link works by clickin on it. If one or more of your links does not work, click the "No" button to re-submit your links. If they are, click the "Yes" button to proceed to the next page, and submit your contact information.
    PAGE_TWOA # #This is the loop that regulates how many links are diplayed #based on how many URL's the User Submits. # my @linkArray=($link1, $link2, $link3, $link4, $link5); my $i=0; for ($i=0;$i<5;$i++) { my $len=length($linkArray[$i]); if ($len > 0) { print "
  1. http://$linkArray[$i]
    "; } } print<

      

    Are These Correct?
PAGE_TWOB } else { print< Tornado Interactive: Did you forget your links?


You must submit at least one valid link into the form. Please Try Again

ERROR_MSG } } #Load's Third Page #Users input contanct information sub pagethree { my $link1b=param("link1b"); my $link2b=param("link2b"); my $link3b=param("link3b"); my $link4b=param("link4b"); my $link5b=param("link5b"); my $custnam=param("custname"); my $emai=param("email"); my $street=param("street"); my $city=param("city"); my $zip=param("zip"); my $state=param("state"); my $country=param("country"); my $phone=param("phone"); my $comments=param("comments"); print< Tornado Interactive: Help us help you!
Please send us your contact information so that we can give you a free quote . Remember, the more information you provide, the easier it will be for us to help you!
At the minimum, we will need your E-Mail Address and Full Name. We do not send spam and all information is kept confidential.
*Required Fields
Full Name:*
Email Address:*
Address:
City:
State:
Postal Code:
Counrty:
Phone Number:
Requests:
PAGE_THREE } #Loads Fourth Page #GIve confirmation of completed form sub pagefive { my $link1b=param("link1b"); my $link2b=param("link2b"); my $link3b=param("link3b"); my $link4b=param("link4b"); my $link5b=param("link5b"); my $custnam=param("custname"); my $emai=param("email"); my $street=param("street"); my $city=param("city"); my $zip=param("zip"); my $state=param("state"); my $country=param("country"); my $phone=param("phone"); my $comments=param("comments"); my $cust=param("custname"); my $custname=length($cust); my $ema=param("email"); my $email=length($ema); if ($custname<1 || $email<4) { print< Tornado Interactive: Did you forget something?


Data Incomplete


The mail form was rejected due to insufficient information. To properly send your Maintenance Request, please fill out:

    TRY_AGAIN if ($custname<1) { print "\n
  • Your Name\n"; } if ($email<4) { print "\n
  • Your Email Address\n"; } print<
TRY_AGAINB } else { print< Tornado Interactive: Thanks For Your Order!
Thank you for Contacting us! You should receive a confirmation E-mail soon verifying that we received your order. You will be contacted through phone or E-mail as soon as possible.

THANK_YOU my $to="Matt\@TornadoInteractive.com"; my $to2="Josh\@TornadoInteractive.com"; my $custname=param("custname"); my $street=param("street"); my $city=param("city"); my $zip=param("zip"); my $state=param("state"); my $country=param("country"); my $phone=param("phone"); my $comments=param("comments"); my $order="Orders\@TornadoInteractive.com"; my $link1=param("link1b"); my $link2=param("link2b"); my $link3=param("link3b"); my $link4=param("link4b"); my $link5=param("link5b"); my $sendmail="/usr/sbin/sendmail -t"; my $return=param("email"); open (MAIL, "|$sendmail") || die "Can't start sendmail: $!"; print MAIL< 0) { print MAIL "$j\: $linkArray[$i]\n"; $j++; } } #print MAIL "Link 1: $link1b \n"; #print MAIL "Link 2: $link2b \n"; #print MAIL "Link 3: $link3b \n"; #print MAIL "Link 4: $link4b \n"; #print MAIL "Link 5: $link5b \n"; close(MAIL); # # #Sends Auto-Response to Person who filled out the form. open (MAIL, "|$sendmail") || die "Can't start sendmail: $!"; print MAIL< 0) { print MAIL "$j\: $linkArray[$i]\n"; $j++; } } #print MAIL "Link 1: $link1 \n"; #print MAIL "Link 2: $link2 \n"; #print MAIL "Link 3: $link3 \n"; #print MAIL "Link 4: $link4 \n"; #print MAIL "Link 5: $link5 \n"; print MAIL "\nIf you feel you have received this message in error, please email us at Support\@TornadoInteractive.com and let us know. \n\n"; print MAIL "Thank you,\n\n"; print MAIL "Matthew Maynes\n"; print MAIL "Josh Burns\n"; print MAIL "Owners, Tornado Interactive"; close(MAIL); # #Ends email # } }