Code: Select all
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>MailDivision</title>
</head>
<body><center>
<table width="400" style="border:1px solid #000000;background-color:#9f9f9f;">
<tr>
<td bgcolor="#000000"> <p align="center"> <font color="#FFFFFF" face="Geneva, Arial, Helvetica, sans-serif">
<?
function check_len(&$check, $field, $max, &$err_field, $err="", $min, $min_err="")
{
if (strlen($field) > $max)
{
if ($err == "")
{
$err = $msg->err_maxlen($max);
}
$err_field = $err;
if ($check==true) $check = false;
}
if (strlen($field) < $min)
{
if ($min_err == "")
{
$min_err = $msg->err_minlen($min);
}
$err_field = $min_err;
if ($check==true) $check = false;
}
}
function check_mail(&$check, $fld, &$error_field, $invalidchars="", $blanks="")
{
global $msg;
$expr = "^ї_\.0-9a-z-]+@(ї0-9a-z]ї0-9a-z-]+\.)+їa-z]їa-z]+\$";
//echo "expr=" . $expr . "<br>";
if ((!$fld) || ($fld=="") || (!eregi($expr,$fld)))
{
if ($invalidchars > "")
{
$error_field = $invalidchars . "<br>\n";
} else {
$error_field = "invalid characters<br>\n";
}
if ($check==true) $check =false;
}
if (strrpos($fld,' ') > 0)
{
if ($blanks > "")
{
$error_field = $blanks . "<br>\n";
} else {
$error_field = "blanks in e-mail<br>\n";
}
if ($check==true) $check =false;
}
}
if (empty($HTTP_POST_VARSї"name"])) $HTTP_POST_VARSї"name"]="";
if (empty($err_name)) $err_name="&nbsp;";
if (empty($HTTP_POST_VARSї"email"])) $HTTP_POST_VARSї"email"]="";
if (empty($err_email)) $err_email="&nbsp;";
if (empty($HTTP_POST_VARSї"phone"])) $HTTP_POST_VARSї"phone"]="";
if (empty($err_phone)) $err_phone="&nbsp;";
if (empty($HTTP_POST_VARSї"address"])) $HTTP_POST_VARSї"address"]="";
if (empty($err_comment)) $err_address="&nbsp;";
if (empty($HTTP_POST_VARSї"product"])) $HTTP_POST_VARSї"product"]="13 Piece Complete Auto Care Bucket,Finish First Auto Polish,Finish Fast,Finish Prep Pre-Cleaner,LVR Protector,<br>
Metal Finish Polishing Cream,Engine Detail Kit,421 MPC,Finish First Wash & Conditioner,Liqui-Tech Wheels/Metal Protector,<br>
Window Finish Glass & Mirror,14 Piece Complete Cycle Care Bucket,Cycle Finish Engine Enhancer/Protector,Cycle Finish Polish,<br>
Cycle Spray Wash & Enhancer,Applicator Pad,3 Piece Starter Kit,5 Piece Cycle Kit,3 Piece Metal Kit,Aqua Dry";
if (empty($err_product)) $err_product="&nbsp;";
$checked = true;
if (isset($HTTP_POST_VARSї"submit"]))
{
check_len($checked, $HTTP_POST_VARSї"name"],30,$err_name,"Field too long! Maximum:30",1,"Field required! Minimum:1");
check_len($checked, $HTTP_POST_VARSї"email"],80,$err_email,"Field too long! Maximum:80",1,"Field required! Minimum:1");
check_mail($checked, $HTTP_POST_VARSї"email"], $err_email,"The e-mail contains invalid characters or is incomplete.", "The e-mail contains blanks.");
check_len($checked, $HTTP_POST_VARSї"address"],300,$err_comment,"Field too long! Maximum:300",0,"Field required! Minimum:1");
check_len($checked, $HTTP_POST_VARSї"products"],80,$err_products,"Field too long! Maximum:80",0,"Field required! Minimum:1");
}
if ( empty($HTTP_POST_VARSї"submit"]) or (!$checked) )
{
?>
<br>
Hold Down CTRL and click to choose more then one product to purchase.</font>
<form action="<? echo $GLOBALSї"PHP_SELF"] ?>" method="post">
<table cellpadding="4" border="0">
<tr>
<td valign="top"><font color="#FFFFFF" face="Geneva, Arial, Helvetica, sans-serif">Name:</font></td>
<td> <font color="#FFFFFF" face="Geneva, Arial, Helvetica, sans-serif">
<input type="text" name="name" value="<? echo $HTTP_POST_VARSї"name"] ?>">
</font></td>
<td> <font color="#FFFFFF" face="Geneva, Arial, Helvetica, sans-serif"><? echo $err_name ?>
</font></td>
</tr>
<tr>
<td valign="top"><font color="#FFFFFF" face="Geneva, Arial, Helvetica, sans-serif">Email:</font></td>
<td> <font color="#FFFFFF" face="Geneva, Arial, Helvetica, sans-serif">
<input type="text" name="email" value="<? echo $HTTP_POST_VARSї"email"] ?>">
</font></td>
<td> <font color="#FFFFFF" face="Geneva, Arial, Helvetica, sans-serif"><? echo $err_email ?>
</font></td>
</tr>
<tr>
<td height="32" valign="top"><font color="#FFFFFF" face="Geneva, Arial, Helvetica, sans-serif">Phone:</font></td>
<td><font color="#FFFFFF" face="Geneva, Arial, Helvetica, sans-serif">
<input type="text" name="phone" value="<? echo $HTTP_POST_VARSї"phone"] ?>">
</font></td>
<td> <font color="#FFFFFF" face="Geneva, Arial, Helvetica, sans-serif"><? echo $err_phone ?>
</font></td>
</tr>
<tr>
<td valign="top"><font color="#FFFFFF" face="Geneva, Arial, Helvetica, sans-serif">Address:</font></td>
<td> <font color="#FFFFFF" face="Geneva, Arial, Helvetica, sans-serif">
<textarea name="address"><? echo $HTTP_POST_VARSї"address"]?></textarea>
</font></td>
<td> <font color="#FFFFFF" face="Geneva, Arial, Helvetica, sans-serif"><? echo $err_address ?>
</font></td>
</tr>
<tr>
<td valign="top"><font color="#FFFFFF" face="Geneva, Arial, Helvetica, sans-serif">Product:</font></td>
<td> <font color="#FFFFFF" face="Geneva, Arial, Helvetica, sans-serif">
<select name="product" size="22" multiple>
<option value=" "> </option>
<option value="13 Piece Complete Auto Care Bucket">13 Piece Complete
Auto Care Bucket</option>
<option value="Finish First Auto Polish">Finish First Auto Polish</option>
<option value="Finish Fast">Finish Fast</option>
<option value="Finish Prep Pre-Cleaner">Finish Prep Pre-Cleaner</option>
<option value="LVR Protector">LVR Protector</option>
<option value="Metal Finish Polishing Cream">Metal Finish Polishing
Cream</option>
<option value="Engine Detail Kit">Engine Detail Kit</option>
<option value="421 MPC">421 MPC</option>
<option value="Finish First Wash & Conditioner">Finish First
Wash & Conditioner</option>
<option value="Liqui-Tech Wheels/Metal Protector">Liqui-Tech Wheels/Metal
Protector</option>
<option value="Window Finish Glass & Mirror">Window Finish
Glass & Mirror</option>
<option value="14 Piece Complete Cycle Care Bucket">14 Piece Complete
Cycle Care Bucket</option>
<option value="Cycle Finish Engine Enhancer/Protector">Cycle Finish
Engine Enhancer/Protector</option>
<option value="Cycle Finish Polish">Cycle Finish Polish</option>
<option value="Cycle Spray Wash & Enhancer">Cycle Spray Wash
& Enhancer</option>
<option value="Applicator Pad">Applicator Pad</option>
<option value="3 Piece Starter Kit">3 Piece Starter Kit</option>
<option value="5 Piece Cycle Kit">5 Piece Cycle Kit</option>
<option value="3 Piece Metal Kit">3 Piece Metal Kit</option>
<option value="Aqua Dry">Aqua Dry</option>
</select>
</font></td>
<td> <font color="#FFFFFF" face="Geneva, Arial, Helvetica, sans-serif"><? echo $err_product ?>
</font></td>
</tr>
<tr>
<td>&nbsp;</td>
<td><font color="#FFFFFF" face="Geneva, Arial, Helvetica, sans-serif">
<input type="submit" name="submit" value="Send">
</font></td>
</tr>
<tr>
<td colspan="2"> </td>
</tr>
<tr>
<td colspan="2">&nbsp; </td>
</tr>
</table>
</form>
<font color="#FFFFFF" face="Geneva, Arial, Helvetica, sans-serif">
<?
}
if (isset($HTTP_POST_VARSї"submit"]) and ($checked) ) {
$msg = "<u>Thank You for Shopping with us. We will contact you soon.</u> \n";
$msg .= "<b>name </b>:".$HTTP_POST_VARSї"name"]."\n";
$msg .= "<b>email </b>:".$HTTP_POST_VARSї"email"]."\n";
$msg .= "<b>phone </b>:".$HTTP_POST_VARSї"phone"]."\n";
$msg .= "<b>address </b>:".$HTTP_POST_VARSї"address"]."\n";
$msg .= "<b>product </b>:".$HTTP_POST_VARSї"product"]."\n";
mail("carl@slashingdesigns.com","You have a new message",
$msg);
echo "Message succesfuly sent to: <br><b><font color=red>Shine On It Sales Department</font></b><br>\n";
echo nl2br($msg) . "<br>\r";
}
?></p>
</font></td>
</tr>
</table>
</body>
</html>