#!/usr/bin/perl
print "Content-type:text/html\n\n";
#$passwd = random_password();
#sub random_password {
# Generate a random password. Alternates vowels and
# consonants, for maximum pronounceability. Uses its own
# list of consonants which exclude F and C and K to prevent
# generating obscene-sounding passwords. Capital I and
# lowercase L are excluded on the basis of looking like
#each other.
# ($length) = @_;
# if ($length eq "" or $length < 3) {
# $length = 6; # make it at least 6 chars long.
# }
# $vowels = "aeiouyAEUY";
# $consonants = "bdghjmnpqrstvwxzBDGHJLMNPQRSTVWXZ12345678";
# srand(time() ^ ($$ + ($$ << 15)) );
# $alt = int(rand(2)) - 1;
# $s = "";
# $newchar = "";
# foreach $i (0..$length-1) {
# if ($alt == 1) {
# $newchar =
#substr($vowels,rand(length($vowels)),1);
# } else {
# $newchar = substr($consonants,
# rand(length($consonants)),1);
# }
# $s .= $newchar;
# $alt = !$alt;
# }
# return $s;
#}
read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
@pairs = split(/&/, $buffer);
foreach $pair (@pairs) {
($name, $value) = split(/=/, $pair);
$value =~ tr/+/ /;
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$FORM{$name} = $value;
}
$mailprog = '/usr/lib/sendmail';
$recipient = $FORM{'emailaddress'};
open (MAIL, "|$mailprog -t") or &dienice("Can't access $mailprog!\n");
print MAIL "To: $recipient\n";
print MAIL "From: useremail\@mycompany.com\n";
print MAIL "Reply-to: useremail\@mycompany.com\\n";
print MAIL "Subject: Spare Parts Form Results\n\n";
print MAIL <<End1;
Thank you for your inquiry. A sales representative will review the information submitted and will contact you.
This is the information you submitted.
MACHINE DETAILS:
=================
W.O. Number: $FORM{'wonumber'}
Machine Type: $FORM{'machinetype'}
Product Type: $FORM{'producttype'}
Machine is in Warranty: $FORM{'machineis'}
Line is Currently: $FORM{'currentline'}
CUSTOMER DETAILS:
====================
Company Name: $FORM{'companyname'}
Contact Name: $FORM{'contactname'}
Phone Number: $FORM{'phonenumber'}
Fax Number: $FORM{'faxnumber'}
E-mail Address: $FORM{'emailaddress'}
Mailing Address: $FORM{'mailingaddress'}
SPARE PARTS:
============
Warranty: $FORM{'warranty'}
Quote: $FORM{'quote'}
Order Number: $FORM{'ordernumber'}
Per Our Quote: $FORM{'perquote'}
P.O.: $FORM{'po'}
Quantity: $FORM{'qty'}
Ceeco Part Number or Drawing Number: $FORM{'ceecopart'}
Description: $FORM{'description'}
OEM Part Number: $FORM{'oempart'}
Documents: $FORM{'documents'}
Comments: $FORM{'comments'}
End1
print <<ENDHTML;
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
<title>Syncro Spare Parts & Technical Documentation</title>
<meta name="generator" content="Microsoft FrontPage 5.0">
<script><!--
CSStopExecution = false;
CSInit = new Array;
function CSScriptInit() {
idxArray = new Array;
for(var i=0;i<CSInit.length;i++)
idxArray[i] = i;
CSAction2(CSInit, idxArray);
}
CSAg = window.navigator.userAgent; CSBVers = parseInt(CSAg.charAt(CSAg.indexOf("/")+1),10);
function IsIE() { return CSAg.indexOf("MSIE") > 0;}
function CSIEStyl(s) { return document.all.tags("div")[s].style; }
function CSNSStyl(s) { return CSFindElement(s,0); }
function CSFindElement(n,ly) { if (CSBVers < 4) return document[n];
var curDoc = ly ? ly.document : document; var elem = curDoc[n];
if (!elem) { for (var i=0;i<curDoc.layers.length;i++) {
elem = CSFindElement(n,curDoc.layers[i]); if (elem) return elem; }}
return elem;
}
function CSButtonReturn () {
var bAgent = window.navigator.userAgent;
var bAppName = window.navigator.appName;
if ((bAppName.indexOf("Explorer") >= 0) && (bAgent.indexOf("Mozilla/3") >= 0) && (bAgent.indexOf("Mac") >= 0))
return false; // follow link
else return true; // follow link
}
CSIm = new Object();
function CSIShow(n,i) {
if (document.images) {
if (CSIm[n]) {
var img = (!IsIE()) ? CSFindElement(n,0) : document[n];
if (img && typeof(CSIm[n][i].src) != "undefined") {img.src = CSIm[n][i].src;}
if(i != 0)
self.status = CSIm[n][3];
else
self.status = " ";
return true;
}
}
return false;
}
function CSILoad(action) {
im = action[1];
if (document.images) {
CSIm[im] = new Object();
for (var i=2;i<5;i++) {
if (action[i] != '') { CSIm[im][i-2] = new Image(); CSIm[im][i-2].src = action[i]; }
else CSIm[im][i-2] = 0;
}
CSIm[im][3] = action[5];
}
}
CSStopExecution = false;
function CSAction(array) {
return CSAction2(CSAct, array);
}
function CSAction2(fct, array) {
var result;
for (var i=0;i<array.length;i++) {
if(CSStopExecution) return false;
var actArray = fct[array[i]];
var tempArray = new Array;
for(var j=1;j<actArray.length;j++) {
if((actArray[j] != null) && (typeof(actArray[j]) == "object") && (actArray[j].length == 2)) {
if(actArray[j][0] == "VAR") {
tempArray[j] = CSStateArray[actArray[j][1]];
}
else {
if(actArray[j][0] == "ACT") {
tempArray[j] = CSAction(new Array(new String(actArray[j][1])));
}
else
tempArray[j] = actArray[j];
}
}
else
tempArray[j] = actArray[j];
}
result = actArray[0](tempArray);
}
return result;
}
CSAct = new Object;
// --></script>
<csactiondict>
<script><!--
CSInit[CSInit.length] = new Array(CSILoad,/*CMP*/'Energy',/*URL*/'en01.gif',/*URL*/'en02.gif',/*URL*/'en03.gif','');
CSInit[CSInit.length] = new Array(CSILoad,/*CMP*/'Telecom',/*URL*/'te01.gif',/*URL*/'te02.gif',/*URL*/'te03.gif','');
CSInit[CSInit.length] = new Array(CSILoad,/*CMP*/'Flexible Pipe',/*URL*/'fp01.gif',/*URL*/'fp02.gif',/*URL*/'fp03.gif','');
CSInit[CSInit.length] = new Array(CSILoad,/*CMP*/'Fiber Optic',/*URL*/'fo01.gif',/*URL*/'fo02.gif',/*URL*/'fo03.gif','');
CSInit[CSInit.length] = new Array(CSILoad,/*CMP*/'Ancillary',/*URL*/'an01.gif',/*URL*/'an02.gif',/*URL*/'an03.gif','');
CSInit[CSInit.length] = new Array(CSILoad,/*CMP*/'button4',/*URL*/'navc01.gif',/*URL*/'navc02.gif',/*URL*/'','');
CSInit[CSInit.length] = new Array(CSILoad,/*CMP*/'button5',/*URL*/'navc01.gif',/*URL*/'navc02.gif',/*URL*/'','');
// --></script>
</csactiondict>
<link href="fonts.css" rel="styleSheet" type="text/css">
<style type="text/css"><!--
a { color: #039; text-decoration: none }-->
</style>
</head>
<body bgcolor="#e7e7e7" leftmargin="0" rightmargin="0" topmargin="0" marginwidth="0" marginheight="0" link="#003399" alink="#ff9900" vlink="#003399" background="sybkgrnd.gif" onload="CSScriptInit();">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr bgcolor="#ff9900">
<td colspan="8" bgcolor="white">
<a href="index.htm">
<img border="0" src="images/ceecobartelllogo.jpg" width="309" height="64"></a></td>
</tr>
<tr height="14" valign="top">
<td height="14" bgcolor="#ff9900" width="39"><img height="14" width="30" src="spacer.gif" align="top"></td>
<td height="14" bgcolor="#ff9900" align="left" width="444"><img height="14" width="117" src="spacer.gif" align="top"></td>
<td width="79" rowspan="2" bgcolor="#003399"><a href="en_top.html" target="_top" onmouseover="return CSIShow(/*CMP*/'Energy',1)" onmouseout="return CSIShow(/*CMP*/'Energy',0)" onclick="CSIShow(/*CMP*/'Energy',2);return CSButtonReturn()">
<img src="en01.gif" name="Energy" border="0" width="79" height="16"></a></td>
<td width="83" rowspan="2" bgcolor="#003399"><a href="te_top.html" target="_top" onmouseover="return CSIShow(/*CMP*/'Telecom',1)" onmouseout="return CSIShow(/*CMP*/'Telecom',0)" onclick="CSIShow(/*CMP*/'Telecom',2);return CSButtonReturn()">
<img src="te01.gif" name="Telecom" border="0" width="83" height="16"></a></td>
<td width="128" rowspan="2" bgcolor="#003399"><a href="fp_top.html" target="_top" onmouseover="return CSIShow(/*CMP*/'Flexible Pipe',1)" onmouseout="return CSIShow(/*CMP*/'Flexible Pipe',0)" onclick="CSIShow(/*CMP*/'Flexible Pipe',2);return CSButtonReturn()">
<img src="fp01.gif" name="Flexible Pipe" border="0" width="128" height="16"></a></td>
<td width="117" rowspan="2" bgcolor="#003399"><a href="fo_top.html" target="_top" onmouseover="return CSIShow(/*CMP*/'Fiber Optic',1)" onmouseout="return CSIShow(/*CMP*/'Fiber Optic',0)" onclick="CSIShow(/*CMP*/'Fiber Optic',2);return CSButtonReturn()">
<img src="fo01.gif" name="Fiber Optic" border="0" width="117" height="16"></a></td>
<td width="104" rowspan="2" bgcolor="#003399" valign="top"><a href="an_top.html" target="_top" onmouseover="return CSIShow(/*CMP*/'Ancillary',1)" onmouseout="return CSIShow(/*CMP*/'Ancillary',0)" onclick="CSIShow(/*CMP*/'Ancillary',2);return CSButtonReturn()">
<img src="an01.gif" name="Ancillary" border="0" width="104" height="16"></a></td>
<td bgcolor="#ff9900" height="14" width="30">
<div align="right">
<img height="14" width="30" src="spacer.gif" align="top"></div>
</td>
</tr>
<tr height="2">
<td bgcolor="white" height="2" width="39"><img height="2" width="30" src="spacer.gif" align="top"></td>
<td height="2" bgcolor="white" width="444"><img height="2" width="117" src="spacer.gif"></td>
<td bgcolor="white" width="30" height="2"><img height="2" width="30" src="spacer.gif"></td>
</tr>
<tr bgcolor="#003399" height="28">
<td width="39" height="28" bordercolor="#003399">
<img height="30" width="39" src="spacer.gif" align="top"></td>
<td height="28" colspan="7" width="985"><img height="30" width="117" src="spacer.gif" align="top"></td>
</tr>
<tr bgcolor="#6699ff" height="2">
<td colspan="8" height="2"><img height="2" width="125" src="spacer.gif"></td>
</tr>
</table>
<table width="743" border="0" cellpadding="0" cellspacing="0" height="259">
<tr height="1">
<td width="1" height="1"></td>
<td width="240" height="1"><spacer type="block" width="240" height="1"></td>
<td width="500" height="1"><spacer type="block" width="500" height="1"></td>
</tr>
<tr height="30">
<td width="1" height="30"><spacer type="block" width="1" height="30"></td>
<td width="240" height="258" colspan="1" rowspan="4" valign="top" align="left" xpos="0">
<table border="0" cellpadding="0" cellspacing="0" width="220">
<tr>
<td colspan="2"><img height="30" width="200" src="spacer.gif"></td>
</tr>
<tr valign="top">
<td colspan="2"><a href="cs_main.html" target="_self"><img height="15" width="20" src="spacer.gif" border="0"><span class="nav3">Customer Service</span></a></td>
</tr>
<tr valign="top">
<td colspan="2"><img height="15" width="125" src="spacer.gif"></td>
</tr>
<tr valign="top">
<td width="30"><a href="#" onmouseover="return CSIShow(/*CMP*/'button4',1)" onmouseout="return CSIShow(/*CMP*/'button4',0)" onclick="return CSButtonReturn()">
<img src="navc01.gif" name="button4" border="0" width="30" height="15"></a></td>
<td valign="middle" width="170"><a href="cs_01.html" target="_self"><span class="nav3">Ceeco
Bartell Spare Parts</span></a></td>
</tr>
<tr valign="middle" height="8">
<td colspan="2" height="8"><img height="15" width="125" src="spacer.gif"></td>
</tr>
<tr valign="top">
<td width="30"><a href="#" onmouseover="return CSIShow(/*CMP*/'button5',1)" onmouseout="return CSIShow(/*CMP*/'button5',0)" onclick="return CSButtonReturn()">
<img src="navc01.gif" name="button5" border="0" width="30" height="15"></a></td>
<td width="170" valign="middle"><a href="cs_02.html" target="_self"><span class="nav3">Ceeco
Bartell Service &<br>
Troubleshooting</span></a></td>
</tr>
<tr height="8">
<td colspan="2" height="8"><img height="15" width="125" src="spacer.gif"></td>
</tr>
<tr height="15">
<td width="30" height="15" valign="top">
<img src="navc02.gif" width="30" height="15"></td>
<td width="170" height="15" valign="middle"><span class="nav3">Syncro Spare Parts &<br>
Technical Documentation</span></td>
</tr>
</table>
</td>
<td width="500" height="30"></td>
</tr>
<tr height="50">
<td width="1" height="50"><spacer type="block" width="1" height="50"></td>
<td width="500" height="50" colspan="1" rowspan="1" valign="top" align="left" xpos="240" content csheight="50">
<p class="subhead"><font size="2">Confirmation</font></td>
</tr>
<tr height="67">
<td width="1" height="67"><spacer type="block" width="1" height="67"></td>
<td width="500" height="67" colspan="1" rowspan="1" valign="top" align="left" xpos="240" content csheight="67">
<font SIZE="2" face="Verdana">Thank you for your inquiry. A
sales representative will review the information submitted and
will contact you.</font><p> </td>
</tr>
<tr height="1153">
<td width="1" height="111"><spacer type="block" width="1" height="1153"></td>
<td width="500" height="111" colspan="1" rowspan="1" valign="top" align="left" xpos="240">
<table border="0" cellpadding="0" cellspacing="0" width="500">
<tr>
<td><img height="20" width="100" src="spacer.gif"></td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
ENDHTML
$mailprog = '/usr/lib/sendmail';
$recipient = " useremail\@mycompany.com\";
open (MAIL, "|$mailprog -t") or &dienice("Can't access $mailprog!\n");
print MAIL "To: $recipient\n";
print MAIL "From: $FORM{'emailaddress'} ($FORM{'contactname'})\n";
print MAIL "Reply-to: $FORM{'emailaddress'} ($FORM{'contactname'})\n";
print MAIL "Subject: Ceeco Bartell Spare Parts Form Results\n\n";
print MAIL <<End1;
MACHINE DETAILS:
=================
W.O. Number: $FORM{'wonumber'}
Machine Type: $FORM{'machinetype'}
Product Type: $FORM{'producttype'}
Machine is in Warranty: $FORM{'machineis'}
Line is Currently: $FORM{'currentline'}
CUSTOMER DETAILS:
====================
Company Name: $FORM{'companyname'}
Contact Name: $FORM{'contactname'}
Phone Number: $FORM{'phonenumber'}
Fax Number: $FORM{'faxnumber'}
E-mail Address: $FORM{'emailaddress'}
Mailing Address: $FORM{'mailingaddress'}
SPARE PARTS:
============
Warranty: $FORM{'warranty'}
Quote: $FORM{'quote'}
Order Number: $FORM{'ordernumber'}
Per Our Quote: $FORM{'perquote'}
P.O.: $FORM{'po'}
Quantity: $FORM{'qty'}
Ceeco Part Number or Drawing Number: $FORM{'ceecopart'}
Description: $FORM{'description'}
OEM Part Number: $FORM{'oempart'}
Documents: $FORM{'documents'}
Comments: $FORM{'comments'}
End1
close(MAIL);
sub dienice {
($errmsg) = @_;
print "<h2>Error</h2>\n";
print "$errmsg<p>\n";
print "</body></html>\n";
exit;
}