hey i tried the stuff you gave on my page..but it just goes blank:
this is my code :
<?
include("../common.php");
if (isset($ordered)) {
$error1=0;
$error2=0;
$error_str1="";
$error_str2="";
for ($i=0;$i<=$num_rows;$i++)
{
if ($quantity[$i]>150)
{
$error1=1;
$error_str1="<font color=\"#ff0000\">For Quanities greater than 120, please contact a Customer Service Representative.</font>";
$sent=0;
}
}
if (($company=="") or ($name=="") or ($address=="") or ($city=="") or ($state=="") or ($zip=="") or ($phone=="") or ($email=="")or($dealer_no==""))
{
$error2=1;
$error_str2="<font color=\"#ff0000\">Please fill in all required fields.</font>";
$sent=0;
}
If (($error1==0) && ($error2==0))
{
$link=mysql_connect($DBhost, $DBuser, $DBpass);
$r=mysql_select_db($DBname,$link);
mysql_query("INSERT INTO orders (name, address, address2, city, state, zip,phone, email,comments,company,dealer_no,dated) VALUES ('$name','$address','$address2','$city','$state','$zip','$phone','$email','" . mysql_escape_string($comments) . "','$company','$dealer_no',now())") or die("Invalid query: " . mysql_error());
$ord_id=mysql_insert_id();
for ($i=0;$i<=$num_rows;$i++)
{
if ($quantity[$i]>=1){
mysql_query("INSERT INTO order_products (order_id, item_id, quantity) values ('$ord_id','$item[$i]','$quantity[$i]')") or die("Invalid query: " . mysql_error());
}
}
mysql_close($link);
$to = "AWS Order <sjensen@amweatherseal.com>" . ", " ; // note the comma
$to .= "Monette Richards <mrichards@merrickgraphics.com>, ";
$to .= "Merrick Graphics <fulfillment@merrickgraphics.com>, ";
$to .= "Steve Merrick <smerrick@merrickgraphics.com>";
$subject = "AWS Dealer Request!";
$message = "<html>
<head><body>
At " . date("j/n/Y G:i:s") . " a request was placed by<br>" .
$name . "<br>" .
$company . "<br>" .
$address . "<br>" .
$address2 . "<br>" .
$city . ", " . $state . " " . $zip . "<br>" .
$phone . "<br>" .
$email . "<br>".
"AWS Dealer#:" . $dealer_no . "<br>".
"for <br>\n";
for ($i=0;$i<=$num_rows;$i++)
{
if ($quantity[$i]>=1){
$message .= $item[$i] . " : " . $quantity[$i] . " <br>\n";
}
}
$message .="<br>" . $comments .
"<br><br><br>Merrick Graphics. Service with a smile.\n" .
"</body>
</html>";
/* To send HTML mail, you can set the Content-type header. */
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\n";
/* additional headers */
$headers .= "From: Merrick Graphics Fullfilment Center <webmaster@merrickgraphics.com> \n";
/* and now mail it */
mail($to, $subject, $message, $headers);
$sent=1;
}
}
function CheckForm(aform) {
var errorString = "The following problems occurred: \r\r";
var validHandle = true;
if ( aform.address.value.length <= 0 ) {
errorString += "Address not supplied. \r";
validHandle = false;
}
if (validHandle == false) {
errorString += "\r";
alert(errorString+'\nPlease make changes and submit the form again.');
}
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="AWSStyles.css" rel="stylesheet" type="text/css">
</head>
<body leftmargin="0" topmargin="00" marginwidth="0" marginheight="0">
<table width="768" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><img src="../SiteArt/AWS-Header.gif" width="768" height="152"></td>
</tr>
</table>
<table width="768" border="0" cellpadding="0" cellspacing="0" bgcolor="#CCCCCC">
<tr align="center">
<td width="10" height="20"> </td>
<td width="1" bgcolor="#FFFFFF"><img src="../SiteArt/t_blank.gif" width="1" height="1"></td>
<td width="70"><a href="
class="MenuCopyText">Home</a></td>
<td width="1" bgcolor="#FFFFFF"><img src="../SiteArt/t_blank.gif" width="1" height="1"></td>
<td width="102"></td>
<td width="185"></td>
<td width="160"></td>
<td width="90"></td>
<td width="60"></td>
<td width="90"></td>
</tr>
</table>
<? if ($sent==1)
{
echo "<center>Your request has been delivered. Thank you.</center><br><br>\n";
}
else
{
?>
<form method="post" onSubmit="return CheckForm(this);">
<table border="0"><tr><td>
<table border="1"><tr><td>
<?
$link=mysql_connect($DBhost, $DBuser, $DBpass);
$r=mysql_select_db($DBname,$link);
$i=1;
$result=mysql_query("SELECT * from items where site LIKE '%%aw%%' or site LIKE '%%ad%%'") or die("Invalid query: " . mysql_error());
while($row = mysql_fetch_array($result))
{
echo "<tr><td><font face=\"Arial, Helvetica, sans-serif\" color=\"#004D3D\">" . $row['name'] . "</font><br><a href=\"../images/large/" . $row['img'] . "\" target=\"window3\" onclick=\"javascript:window.open('', 'window3', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=400, height=390')\"><img src=\"../images/" . $row['img'] . "\" border=\"0\" width=\"120\" height=\"83\"></a><br>" . stripslashes($row['id_code']) . "<br></td><td><input type=\"hidden\" name=\"item[" . $i . "]\" value=\"" . $row['id_code'] . "\"><input type=\"text\" name=\"quantity[" . $i. "]\" size=\"2\" value=\"" . $quantity[$i] . "\"> <font face=\"Arial, Helvetica, sans-serif\">Quantity</td></tr>\n";
$i++;
}
$num_rows = mysql_num_rows($result);
mysql_free_result($result);
mysql_close($link);
$i++;
?>
</td></tr></table>
</td><td valign="top">
<table border="0">
<tr><td colspan="2"><? echo $error_str1;?></td></tr>
<tr><td colspan="2"><? echo $error_str2;?></td></tr>
<tr><td><font color="#ff0000">*</font>Company: </td><td><input type="text" name="company" size="25" value="<?echo $company;?>"></td></tr>
<tr><td><font color="#ff0000">*</font>Name: </td><td><input type="text" name="name" size="25" value="<?echo $name;?>"></td></tr>
<tr><td><font color="#ff0000">*</font>Address: </td><td><input type="text" name="address" size="25" wrap="PHYSICAL" value="<?echo $address;?>"></td></tr>
<tr><td>Address: </td><td><input type="text" name="address2" size="25" wrap="PHYSICAL" value="<?echo $address2;?>"></td></tr>
<tr><td><font color="#ff0000">*</font>City: </td><td><input type="text" name="city" size="25" value="<?echo $city;?>"></td></tr>
<tr><td><font color="#ff0000">*</font>State: </td><td><input type="text" name="state" size="2" value="<?echo $state;?>"></td></tr>
<tr><td><font color="#ff0000">*</font>Zip: </td><td><input type="text" name="zip" size="11" value="<?echo $zip;?>"></td></tr>
<tr><td><font color="#ff0000">*</font>Phone: </td><td><input type="text" name="phone" size="25" value="<?echo $phone;?>"></td></tr>
<tr><td><font color="#ff0000">*</font>Email: </td><td><input type="text" name="email" size="25" value="<?echo $email;?>"></td></tr>
<tr><td><font color="#ff0000">*</font>AWS Dealer#: </td><td><input type="text" name="dealer_no" size="25" value="<?echo $dealer_no;?>"></td></tr>
<tr><td>Comments: </td><td><textarea name="comments" cols="25" rows="5"><?echo $comments;?></textarea></td></tr>
<tr><td></td><td><input type="hidden" name="ordered" value="1"><input type="hidden" name="num_rows" value="<?echo $num_rows;?>"><input type="submit" value="sumbmit" name="Order"></td></tr>
</table>
</td></tr></table>
</form>
<?
}
?>
</body>
</html>