#!/usr/local/bin/perl
# -------------------------------------------------------------------------
# boutique.cgi - Based on the HTML file, C:\TRANSFER\BOUTIQUE.HTM
#        1. Please make sure that the control structure is not altered.
#        2. Save the edited file in text form.
#        3. Transfer this file to the WWW server in ASCII mode.
#        4. Set its protection to world read, execute (e.g. chmod 755 filename)
# -------------------------------------------------------------------------
# (To see if the script works as intended: Type 'thisfile.pl < test', where test is a text file containing
#  the item identifiers as, Item1=string&Item2=string&Item3=...
#  Alternatively, you may like to install the CGI and HTML and test via the form.)
# -------------------------------------------------------------------------

# -------------------------------------------------------------------------
# Start of the Perl script:
# -------------------------------------------------------------------------
# Procedure to send mail
sub do_mail
{
  local($filename) = "/tmp/cf-$$";
  open(TFILE,">$filename");

# >>>>> Start of User configurable section 1 of 2 >>>>>
# The mail subject will be at the top of the message.
   print TFILE "*************************************\n";
   print TFILE "Title: Happyclown Boutique Order Form\n";
   print TFILE "*************************************\n\n";

  if ($baseball_cap ne "")
  {
   print TFILE "Baseball Cap:		$baseball_cap\n";
  }

  if ($baseball_cap_style ne "")
  {
   print TFILE "Style:			$baseball_cap_style\n";
  }

  if ($baseball_cap_quantity ne "")
  {
   print TFILE "Quantity:		$baseball_cap_quantity\n";
  }

  if ($t_shirt ne "")
  {
   print TFILE "*************************************\n";
  }

  if ($t_shirt ne "")
  {
   print TFILE "T-Shirt:		$t_shirt\n";
  }

  if ($t_shirt_size ne "")
  {
   print TFILE "Size:			$t_shirt_size\n";
  }

  if ($t_shirt_quantity ne "")
  {
   print TFILE "Quantity:		$t_shirt_quantity\n";
  }

  if ($tie_clip ne "")
  {
   print TFILE "*************************************\n";
  }

  if ($tie_clip ne "")
  {
   print TFILE "Tie Clip:		$tie_clip\n";
  }

  if ($tie_clip_style ne "")
  {
   print TFILE "Style:			$tie_clip_style\n";
  }

  if ($tie_clip_quantity ne "")
  {
   print TFILE "Quantity:		$tie_clip_quantity\n";
  }

  if ($cufflinks ne "")
  {
   print TFILE "*************************************\n";
  }

  if ($cufflinks ne "")
  {
   print TFILE "Cufflinks:		$cufflinks\n";
  }

  if ($cufflinks_style ne "")
  {
   print TFILE "Style:			$cufflinks_style\n";
  }

  if ($cufflinks_quantity ne "")
  {
   print TFILE "Quantity:		$cufflinks_quantity\n";
  }

  if ($bathrobe ne "")
  {
   print TFILE "*************************************\n";
  }

  if ($bathrobe ne "")
  {
   print TFILE "Bathrobe:		$bathrobe\n";
  }

  if ($bathrobe_size ne "")
  {
   print TFILE "Size:			$bathrobe_size\n";
  }

  if ($bathrobe_quantity ne "")
  {
   print TFILE "Quantity:		$bathrobe_quantity\n";
  }

  if ($wall_clock ne "")
  {
   print TFILE "*************************************\n";
  }

  if ($wall_clock ne "")
  {
   print TFILE "Wall Clock:		$wall_clock\n";
  }

  if ($wall_clock_style ne "")
  {
   print TFILE "Style:			$wall_clock_style\n";
  }

  if ($wall_clock_quantity ne "")
  {
   print TFILE "Quantity:		$wall_clock_quantity\n";
  }

  if ($poster_sticker_set ne "")
  {
   print TFILE "*************************************\n";
  }

  if ($poster_sticker_set ne "")
  {
   print TFILE "Poster/Sticker Set:	$poster_sticker_set\n";
  }

  if ($poster_sticker_set_size ne "")
  {
   print TFILE "Set Size:		$poster_sticker_set_size\n";
  }

  if ($poster_sticker_set_quantity ne "")
  {
   print TFILE "Quantity:		$poster_sticker_set_quantity\n";
  }

   print TFILE "*************************************\n";

  if ($pay ne "")
  {
   print TFILE "Form of Payment:	$pay\n";
  }

  if ($card ne "")
  {
   print TFILE "Card Type:		$card\n";
  }

  if ($ccname ne "")
  {
   print TFILE "Card Holder:		$ccname\n";
  }

  if ($ccnumber ne "")
  {
   print TFILE "Card Number:		$ccnumber\n";
  }

  if ($ccexpdate ne "")
  {
   print TFILE "Expiry Date:		$ccexpdate\n";
  }

   print TFILE "*************************************\n";

   print TFILE "Customer Information\n";

  if ($customer_name ne "")
  {
   print TFILE "Name:			$customer_name\n";
  }

  if ($customer_address ne "")
  {
   print TFILE "Address:		$customer_address\n";
  }

  if ($customer_city ne "")
  {
   print TFILE "City:			$customer_city\n";
  }

  if ($customer_state ne "")
  {
   print TFILE "State:			$customer_state\n";
  }

  if ($customer_zip ne "")
  {
   print TFILE "Zip:			$customer_zip\n";
  }

  if ($customer_country ne "")
  {
   print TFILE "Country:		$customer_country\n";
  }

  if ($customer_phone ne "")
  {
   print TFILE "Phone:			$customer_phone\n";
  }

  if ($customer_fax ne "")
  {
   print TFILE "Fax:			$customer_fax\n";
  }

  if ($customer_email ne "")
  {
   print TFILE "E-Mail:			$customer_email\n";
  }

  if ($customer_url ne "")
  {
   print TFILE "URL(s):			$customer_url\n";
  }

  if ($mailling_list ne "")
  {
   print TFILE "Join Mailling List:	$mailling_list\n";
  }

  close(TFILE);
 `/usr/bin/mail  $mailreceiver < $filename`;
  $mailstatus = $?;
  unlink("$filename");
}
# <<<<< End of User configurable section 1 of 2 <<<<<
# >>>>> Do not alter anything in the following section >>>>>
# convert %20 to a space and other %dd to a character
sub reformat
{
  local($tmp) = $_[0] ;
  $tmp =~ s/\+/ /g ;
  while ($tmp =~ /%([0-9A-Fa-f][0-9A-Fa-f])/)
{
      $num = $1;
      $dec = hex($num);
      $chr = pack("c",$dec);
      $chr =~ s/&/and/g;  # Replace if it is the & char.
      $tmp =~ s/%$num/$chr/g;
  }
  return($tmp);
}

# Main body of the script
sub do_main
{
  $cl = $ENV{'CONTENT_LENGTH'};
  if ($cl > 0)
  {
   read(STDIN, $_, $cl);
   $_ .= "&"; # Append an & char so that the last item is not ignored
   $pquery = &reformat($_);

   while ($pquery =~ /baseball_cap=([^&]*)&/) {
      if (!$baseball_cap) {
         $baseball_cap = $1;
      }
      else {
         $baseball_cap = $baseball_cap."\n        ".$1;
      }
      $pquery =~ s/baseball_cap=([^&]*)//;
   }
   $baseball_cap = &reformat($baseball_cap);

   while ($pquery =~ /baseball_cap_style=([^&]*)&/) {
      if (!$baseball_cap_style) {
         $baseball_cap_style = $1;
      }
      else {
         $baseball_cap_style = $baseball_cap_style."\n        ".$1;
      }
      $pquery =~ s/baseball_cap_style=([^&]*)//;
   }
   $baseball_cap_style = &reformat($baseball_cap_style);

   while ($pquery =~ /baseball_cap_quantity=([^&]*)&/) {
      if (!$baseball_cap_quantity) {
         $baseball_cap_quantity = $1;
      }
      else {
         $baseball_cap_quantity = $baseball_cap_quantity."\n        ".$1;
      }
      $pquery =~ s/baseball_cap_quantity=([^&]*)//;
   }
   $baseball_cap_quantity = &reformat($baseball_cap_quantity);

   while ($pquery =~ /t_shirt=([^&]*)&/) {
      if (!$t_shirt) {
         $t_shirt = $1;
      }
      else {
         $t_shirt = $t_shirt."\n        ".$1;
      }
      $pquery =~ s/t_shirt=([^&]*)//;
   }
   $t_shirt = &reformat($t_shirt);

   while ($pquery =~ /t_shirt_size=([^&]*)&/) {
      if (!$t_shirt_size) {
         $t_shirt_size = $1;
      }
      else {
         $t_shirt_size = $t_shirt_size."\n        ".$1;
      }
      $pquery =~ s/t_shirt_size=([^&]*)//;
   }
   $t_shirt_size = &reformat($t_shirt_size);

   while ($pquery =~ /t_shirt_quantity=([^&]*)&/) {
      if (!$t_shirt_quantity) {
         $t_shirt_quantity = $1;
      }
      else {
         $t_shirt_quantity = $t_shirt_quantity."\n        ".$1;
      }
      $pquery =~ s/t_shirt_quantity=([^&]*)//;
   }
   $t_shirt_quantity = &reformat($t_shirt_quantity);

   while ($pquery =~ /tie_clip=([^&]*)&/) {
      if (!$tie_clip) {
         $tie_clip = $1;
      }
      else {
         $tie_clip = $tie_clip."\n        ".$1;
      }
      $pquery =~ s/tie_clip=([^&]*)//;
   }
   $tie_clip = &reformat($tie_clip);

   while ($pquery =~ /tie_clip_style=([^&]*)&/) {
      if (!$tie_clip_style) {
         $tie_clip_style = $1;
      }
      else {
         $tie_clip_style = $tie_clip_style."\n        ".$1;
      }
      $pquery =~ s/tie_clip_style=([^&]*)//;
   }
   $tie_clip_style = &reformat($tie_clip_style);

   while ($pquery =~ /tie_clip_quantity=([^&]*)&/) {
      if (!$tie_clip_quantity) {
         $tie_clip_quantity = $1;
      }
      else {
         $tie_clip_quantity = $tie_clip_quantity."\n        ".$1;
      }
      $pquery =~ s/tie_clip_quantity=([^&]*)//;
   }
   $tie_clip_quantity = &reformat($tie_clip_quantity);

   while ($pquery =~ /cufflinks=([^&]*)&/) {
      if (!$cufflinks) {
         $cufflinks = $1;
      }
      else {
         $cufflinks = $cufflinks."\n        ".$1;
      }
      $pquery =~ s/cufflinks=([^&]*)//;
   }
   $cufflinks = &reformat($cufflinks);

   while ($pquery =~ /cufflinks_style=([^&]*)&/) {
      if (!$cufflinks_style) {
         $cufflinks_style = $1;
      }
      else {
         $cufflinks_style = $cufflinks_style."\n        ".$1;
      }
      $pquery =~ s/cufflinks_style=([^&]*)//;
   }
   $cufflinks_style = &reformat($cufflinks_style);

   while ($pquery =~ /cufflinks_quantity=([^&]*)&/) {
      if (!$cufflinks_quantity) {
         $cufflinks_quantity = $1;
      }
      else {
         $cufflinks_quantity = $cufflinks_quantity."\n        ".$1;
      }
      $pquery =~ s/cufflinks_quantity=([^&]*)//;
   }
   $cufflinks_quantity = &reformat($cufflinks_quantity);

   while ($pquery =~ /bathrobe=([^&]*)&/) {
      if (!$bathrobe) {
         $bathrobe = $1;
      }
      else {
         $bathrobe = $bathrobe."\n        ".$1;
      }
      $pquery =~ s/bathrobe=([^&]*)//;
   }
   $bathrobe = &reformat($bathrobe);

   while ($pquery =~ /bathrobe_size=([^&]*)&/) {
      if (!$bathrobe_size) {
         $bathrobe_size = $1;
      }
      else {
         $bathrobe_size = $bathrobe_size."\n        ".$1;
      }
      $pquery =~ s/bathrobe_size=([^&]*)//;
   }
   $bathrobe_size = &reformat($bathrobe_size);

   while ($pquery =~ /bathrobe_quantity=([^&]*)&/) {
      if (!$bathrobe_quantity) {
         $bathrobe_quantity = $1;
      }
      else {
         $bathrobe_quantity = $bathrobe_quantity."\n        ".$1;
      }
      $pquery =~ s/bathrobe_quantity=([^&]*)//;
   }
   $bathrobe_quantity = &reformat($bathrobe_quantity);

   while ($pquery =~ /wall_clock=([^&]*)&/) {
      if (!$wall_clock) {
         $wall_clock = $1;
      }
      else {
         $wall_clock = $wall_clock."\n        ".$1;
      }
      $pquery =~ s/wall_clock=([^&]*)//;
   }
   $wall_clock = &reformat($wall_clock);

   while ($pquery =~ /wall_clock_style=([^&]*)&/) {
      if (!$wall_clock_style) {
         $wall_clock_style = $1;
      }
      else {
         $wall_clock_style = $wall_clock_style."\n        ".$1;
      }
      $pquery =~ s/wall_clock_style=([^&]*)//;
   }
   $wall_clock_style = &reformat($wall_clock_style);

   while ($pquery =~ /wall_clock_quantity=([^&]*)&/) {
      if (!$wall_clock_quantity) {
         $wall_clock_quantity = $1;
      }
      else {
         $wall_clock_quantity = $wall_clock_quantity."\n        ".$1;
      }
      $pquery =~ s/wall_clock_quantity=([^&]*)//;
   }
   $wall_clock_quantity = &reformat($wall_clock_quantity);

   while ($pquery =~ /poster_sticker_set=([^&]*)&/) {
      if (!$poster_sticker_set) {
         $poster_sticker_set = $1;
      }
      else {
         $poster_sticker_set = $poster_sticker_set."\n        ".$1;
      }
      $pquery =~ s/poster_sticker_set=([^&]*)//;
   }
   $poster_sticker_set = &reformat($poster_sticker_set);

   while ($pquery =~ /poster_sticker_set_size=([^&]*)&/) {
      if (!$poster_sticker_set_size) {
         $poster_sticker_set_size = $1;
      }
      else {
         $poster_sticker_set_size = $poster_sticker_set_size."\n        ".$1;
      }
      $pquery =~ s/poster_sticker_set_size=([^&]*)//;
   }
   $poster_sticker_set_size = &reformat($poster_sticker_set_size);

   while ($pquery =~ /poster_sticker_set_quantity=([^&]*)&/) {
      if (!$poster_sticker_set_quantity) {
         $poster_sticker_set_quantity = $1;
      }
      else {
         $poster_sticker_set_quantity = $poster_sticker_set_quantity."\n        ".$1;
      }
      $pquery =~ s/poster_sticker_set_quantity=([^&]*)//;
   }
   $poster_sticker_set_quantity = &reformat($poster_sticker_set_quantity);

   while ($pquery =~ /pay=([^&]*)&/) {
      if (!$pay) {
         $pay = $1;
      }
      else {
         $pay = $pay."\n        ".$1;
      }
      $pquery =~ s/pay=([^&]*)//;
   }
   $pay = &reformat($pay);

   while ($pquery =~ /card=([^&]*)&/) {
      if (!$card) {
         $card = $1;
      }
      else {
         $card = $card."\n        ".$1;
      }
      $pquery =~ s/card=([^&]*)//;
   }
   $card = &reformat($card);

   while ($pquery =~ /ccname=([^&]*)&/) {
      if (!$ccname) {
         $ccname = $1;
      }
      else {
         $ccname = $ccname."\n        ".$1;
      }
      $pquery =~ s/ccname=([^&]*)//;
   }
   $ccname = &reformat($ccname);

   while ($pquery =~ /ccnumber=([^&]*)&/) {
      if (!$ccnumber) {
         $ccnumber = $1;
      }
      else {
         $ccnumber = $ccnumber."\n        ".$1;
      }
      $pquery =~ s/ccnumber=([^&]*)//;
   }
   $ccnumber = &reformat($ccnumber);

   while ($pquery =~ /ccexpdate=([^&]*)&/) {
      if (!$ccexpdate) {
         $ccexpdate = $1;
      }
      else {
         $ccexpdate = $ccexpdate."\n        ".$1;
      }
      $pquery =~ s/ccexpdate=([^&]*)//;
   }
   $ccexpdate = &reformat($ccexpdate);

   while ($pquery =~ /customer_name=([^&]*)&/) {
      if (!$customer_name) {
         $customer_name = $1;
      }
      else {
         $customer_name = $customer_name."\n        ".$1;
      }
      $pquery =~ s/customer_name=([^&]*)//;
   }
   $customer_name = &reformat($customer_name);

   while ($pquery =~ /customer_address=([^&]*)&/) {
      if (!$customer_address) {
         $customer_address = $1;
      }
      else {
         $customer_address = $customer_address."\n        ".$1;
      }
      $pquery =~ s/customer_address=([^&]*)//;
   }
   $customer_address = &reformat($customer_address);

   while ($pquery =~ /customer_city=([^&]*)&/) {
      if (!$customer_city) {
         $customer_city = $1;
      }
      else {
         $customer_city = $customer_city."\n        ".$1;
      }
      $pquery =~ s/customer_city=([^&]*)//;
   }
   $customer_city = &reformat($customer_city);

   while ($pquery =~ /customer_state=([^&]*)&/) {
      if (!$customer_state) {
         $customer_state = $1;
      }
      else {
         $customer_state = $customer_state."\n        ".$1;
      }
      $pquery =~ s/customer_state=([^&]*)//;
   }
   $customer_state = &reformat($customer_state);

   while ($pquery =~ /customer_zip=([^&]*)&/) {
      if (!$customer_zip) {
         $customer_zip = $1;
      }
      else {
         $customer_zip = $customer_zip."\n        ".$1;
      }
      $pquery =~ s/customer_zip=([^&]*)//;
   }
   $customer_zip = &reformat($customer_zip);

   while ($pquery =~ /customer_country=([^&]*)&/) {
      if (!$customer_country) {
         $customer_country = $1;
      }
      else {
         $customer_country = $customer_country."\n        ".$1;
      }
      $pquery =~ s/customer_country=([^&]*)//;
   }
   $customer_country = &reformat($customer_country);

   while ($pquery =~ /customer_phone=([^&]*)&/) {
      if (!$customer_phone) {
         $customer_phone = $1;
      }
      else {
         $customer_phone = $customer_phone."\n        ".$1;
      }
      $pquery =~ s/customer_phone=([^&]*)//;
   }
   $customer_phone = &reformat($customer_phone);

   while ($pquery =~ /customer_fax=([^&]*)&/) {
      if (!$customer_fax) {
         $customer_fax = $1;
      }
      else {
         $customer_fax = $customer_fax."\n        ".$1;
      }
      $pquery =~ s/customer_fax=([^&]*)//;
   }
   $customer_fax = &reformat($customer_fax);

   while ($pquery =~ /customer_email=([^&]*)&/) {
      if (!$customer_email) {
         $customer_email = $1;
      }
      else {
         $customer_email = $customer_email."\n        ".$1;
      }
      $pquery =~ s/customer_email=([^&]*)//;
   }
   $customer_email = &reformat($customer_email);

   while ($pquery =~ /customer_url=([^&]*)&/) {
      if (!$customer_url) {
         $customer_url = $1;
      }
      else {
         $customer_url = $customer_url."\n        ".$1;
      }
      $pquery =~ s/customer_url=([^&]*)//;
   }
   $customer_url = &reformat($customer_url);

   while ($pquery =~ /mailling_list=([^&]*)&/) {
      if (!$mailling_list) {
         $mailling_list = $1;
      }
      else {
         $mailling_list = $mailling_list."\n        ".$1;
      }
      $pquery =~ s/mailling_list=([^&]*)//;
   }
   $mailling_list = &reformat($mailling_list);

# <<<<< Do not alter anything in the above section <<<<<
# >>>>> Start of User configurable section 2 of 2 >>>>>
  print "Content-type: text/html\n\n";
  print "<html><HEAD>\n<TITLE>Your form has been sent...</TITLE>\n</HEAD>\n";
  print "<body bgcolor=#FFFFFF link=#408080 vlink=#FF8000 alink=#FF0000 text=#FF8000>\n";
  print "<font color=#FF0000><h1>Acknowledgement</h1></font>\n";
  print "<h2>Thank you for your order.</h2><h3>We will contact you ASAP.</h3>\n";
  print "<hr><h2>The following data has been sent. </h2>\n";
  print "<pre>";
  if ($baseball_cap ne "")
  {
   print "Baseball Cap:		: $baseball_cap\n";
  }

  if ($baseball_cap_style ne "")
  {
   print "Style:			: $baseball_cap_style\n";
  }

  if ($baseball_cap_quantity ne "")
  {
   print "Quantity:		: $baseball_cap_quantity\n";
  }

  if ($t_shirt ne "")
  {
   print "<hr>\n";
  }

  if ($t_shirt ne "")
  {
   print "T-Shirt:		: $t_shirt\n";
  }

  if ($t_shirt_size ne "")
  {
   print "Size:			: $t_shirt_size\n";
  }

  if ($t_shirt_quantity ne "")
  {
   print "Quantity:		: $t_shirt_quantity\n";
  }

  if ($tie_clip ne "")
  {
   print "<hr>\n";
  }

  if ($tie_clip ne "")
  {
   print "Tie Clip:		: $tie_clip\n";
  }

  if ($tie_clip_style ne "")
  {
   print "Style:			: $tie_clip_style\n";
  }

  if ($tie_clip_quantity ne "")
  {
   print "Quantity:		: $tie_clip_quantity\n";
  }

  if ($cufflinks ne "")
  {
   print "<hr>\n";
  }

  if ($cufflinks ne "")
  {
   print "Cufflinks:		: $cufflinks\n";
  }

  if ($cufflinks_style ne "")
  {
   print "Style:			: $cufflinks_style\n";
  }

  if ($cufflinks_quantity ne "")
  {
   print "Quantity:		: $cufflinks_quantity\n";
  }

  if ($bathrobe ne "")
  {
   print "<hr>\n";
  }

  if ($bathrobe ne "")
  {
   print "Bathrobe:		: $bathrobe\n";
  }

  if ($bathrobe_size ne "")
  {
   print "Size:			: $bathrobe_size\n";
  }

  if ($bathrobe_quantity ne "")
  {
   print "Quantity:		: $bathrobe_quantity\n";
  }

  if ($wall_clock ne "")
  {
   print "<hr>\n";
  }

  if ($wall_clock ne "")
  {
   print "Wall Clock:		: $wall_clock\n";
  }

  if ($wall_clock_style ne "")
  {
   print "Style:			: $wall_clock_style\n";
  }

  if ($wall_clock_quantity ne "")
  {
   print "Quantity:		: $wall_clock_quantity\n";
  }

  if ($poster_sticker_set ne "")
  {
   print "<hr>\n";
  }

  if ($poster_sticker_set ne "")
  {
   print "Poster/Sticker Set:	: $poster_sticker_set\n";
  }

  if ($poster_sticker_set_size ne "")
  {
   print "Set Size:		: $poster_sticker_set_size\n";
  }

  if ($poster_sticker_set_quantity ne "")
  {
   print "Quantity:		: $poster_sticker_set_quantity\n";
  }

   print "<p align=center><b><font size=+4 color=#FF8000>............</font><font size=+4 color=#FF0000>......</font></b></p>\n";

  if ($pay ne "")
  {
   print "Form of Payment:	: $pay\n";
  }

  if ($card ne "")
  {
   print "Card Type:		: $card\n";
  }

  if ($ccname ne "")
  {
   print "Card Holder:		: $ccname\n";
  }

  if ($ccnumber ne "")
  {
   print "Card Number:		: $ccnumber\n";
  }

  if ($ccexpdate ne "")
  {
   print "Expire Date:		: $ccexpdate\n";
  }

  if ($customer_name ne "")
  {
   print "<hr>\n";
  }

  if ($customer_name ne "")
  {
   print "Your Name:		: $customer_name\n";
  }

  if ($customer_address ne "")
  {
   print "Address:		: $customer_address\n";
  }

  if ($customer_city ne "")
  {
   print "City:			: $customer_city\n";
  }

  if ($customer_state ne "")
  {
   print "State:			: $customer_state\n";
  }

  if ($customer_zip ne "")
  {
   print "Zip:			: $customer_zip\n";
  }

  if ($customer_country ne "")
  {
   print "Country:		: $customer_country\n";
  }

  if ($customer_phone ne "")
  {
   print "Telephone:		: $customer_phone\n";
  }

  if ($customer_fax ne "")
  {
   print "Fax:			: $customer_fax\n";
  }

  if ($customer_email ne "")
  {
   print "E-Mail:			: $customer_email\n";
  }

  if ($customer_url ne "")
  {
   print "URL(s):			: $customer_url\n";
  }

  if ($mailling_list ne "")
  {
   print "Join Mailling List:	: $mailling_list\n";
  }

  print "</pre>";
  print "<hr>\n";
  &do_mail;
  print "<h3>Sent at $misterwolf from $ENV{'REMOTE_HOST'}</h3>\n";
   if ($mailstatus == 0)
    {
     print "<P><h3>Mail successfully sent.</h3>\n";
    }
    else
    {
     print "<P><h3><Blink>An error occurred when sending the mail. </Blink></h3><br>\n";
     print "The error status was $mailstatus).\n";
    }
print "<p align=center>\n";
print "<b><font size=+6 color=#FF0000>. . .</font></b><br>\n";
print "<font size=-1 color=#800040>\n";
print "<a href=http://www.happyclown.com/mainmenu.html>[Home]</a>\n";
print "<a href=http://www.happyclown.com/clown.html>[Happyclown]</a>\n";
print "<a href=http://www.happyclown.com/new.html>[New]</a>\n";
print "<a href=http://www.happyclown.com/projects.html>[Projects]</a>\n";
print "<a href=http://www.avic.org>[AVIC]</a>\n";
print "<a href=http://www.happyclown.com/links.html>[Links]</a></font></p>\n";

print "<p align=center><font color=#FF8000 size=-2>&copy; </font><font color=#FF0000 size=-2>Happyclown Inc.</font></p></body>\n";
  }
}
# <<<<< End of User configurable section 2 of 2 <<<<<

$misterwolf = `/bin/date`; $misterwolf =~ s/\n//g ;
$mailreceiver = "bignose\@happyclown.com";

$|=1;
eval '&do_main';
sleep(1);

# ***** End of the Perl Script file. *****
