Hi Guys...
Thank you very much for responding to my query.
I don't think that I explained myself very clearly, so here goes again.
I am testing a script that displayes a form with 8 items. The finished script will have around 150 - 200 items.
Each Item has 4 elements to it:
Description; Pack Qty; Price; Quantity.
The items are called from a database, except for the quantity which is user input.
I do 2 things with the input from the form.
1. I send a response page to confirm what the user has input.
2. I send an email to myself to show what the user has input.
When I test the form input, I fill in all 8 quantities.
The resultant response only shows the LAST item in both response form and email sent to me.
What I need is to show ALL the items where a quantity is filled in to show on the response page, and the email that is sent to me.
Here is my response script:
Code:
$template = join('',file('response_template.tpl'));
$total = $trade*$quantity;
$total = number_format($total , 2 );
$content = "<table align=center width=600 cellpadding=0 cellspacing=0 border=0>
<tr><td colspan=2>";
$content .= "<center><br /><br /><font size=2 ><b>Hi $name.....</b><br /><br /></center>\n";
$content .= "<center><font size=3 ><b>Thank you for Order.</b><br /><br /></center>\n";
$content .= "<font size=2><b>Your order (detailed below) has been sent to Hughes Family Bakers. </b></font><hr />\n";
$content .= "<font size=2 color=#ff0000><B>Here is what you ordered:-</b></font><br />\n";
$content .= "<center><table width=100% border=0 align=CENTER cellspacing=0 cellpadding=10><tr><td>";
$content .= "<table align=center width=99% cellpadding=0 cellspacing=0 border=0>";
$content .= "<tr height='30'>";
$content .= "<td width='100'><font size=2 color='#ff0000'><b>Quantity</b></font> </td>\n";
$content .= "<td><font size=2 color='#ff0000'><b>Product</b></font> </td>\n";
$content .= "<td width='50'><font size=2 color='#ff0000'>Price</td>";
$content .= "<td width='100'><font size=2 color='#ff0000'>Total</td>";
$content .= "</td></tr>";
$content .= "<tr>";
$content .= "<td><font size=2><b>$quantity</b></font> </td>\n";
$content .= "<td><font size=2><b>$product</b></font> </td>\n";
$content .= "<td><font size=2><b>$trade</b></font></td>";
$content .= "<td><font size=2><b>£$total</b></font></td>";
$content .= "</tr></table><br>";
$content .= "</td></tr></table></center>";
$content .= "<font size=2><b>Your order is valuable to us. We will contact you as soon as we can. </b></font><br />";
$content .= "</td></tr></table></center><br>";
$template = str_replace("[content]",$content,$template);
print $template;
Any advice on how to get all the items showing will be appreciated.
Thanks...