PHP Order Forms From While Loop .. I Need Help
Posted: Tue Nov 15, 2011 7:52 am
Hi All. Im making a website for a customer and have tried everything to get this working the way he wants it. Ive got a while loop getting products for sale from a sql database. i have a textbox in each product bar. what he needs is the text box used for entering quantity and only one button on the bottom of the page that takes you to a review page with a list of what items have a quantity of 1 or more, To eventually be sent to 3 emails.
I need help doing this at the moment i have textboxes that dont do nothing.
Heres the code and a current screenshot of the page please please help ive been 2 weeks trying to figure this out.
Screenshot:
http://www.malloukcompany.com.au/1.png

I need help doing this at the moment i have textboxes that dont do nothing.
Heres the code and a current screenshot of the page please please help ive been 2 weeks trying to figure this out.
Code: Select all
<?php
$qty = 0
?>
<?php
// Script Error Reporting
error_reporting(E_ALL);
ini_set('display_errors', '1');
?>
<!-- ONE --------------------------------------------------------------------------------------------------->
<?php
include "storescripts/connect_to_mysql.php";
$list = "";
$sql = mysql_query("SELECT * FROM food ORDER BY id ASC");
$productCount = mysql_num_rows($sql); // count the output amount
if ($productCount > 0) {
while($row = mysql_fetch_array($sql)){
$id = $row["id"];
$product_code = $row["product_code"];
$description = $row["description"];
$units_per_product = $row["units_per_product"];
$product_price = $row["product_price"];
$unit_price = $row["unit_price"];
$points = $row["points"];
$subcategory = $row["subcategory"];
$list .= '<body topmargin="0" leftmargin="0">
<div align="center">
<table cellpadding="0" cellspacing="0" border="0" bordercolor="#C0C0C0" width="768" height="45">
<!-- MSTableType="layout" -->
<tr>
<td valign="middle" width="88" style="border-left-style: solid; border-left-width: 1px; border-top-style: solid; border-top-width: 1px; border-bottom-style: solid; border-bottom-width: 1px; border-right-style:none; border-right-width:medium">
<font face="Verdana" size="1"> ' .$product_code. '</font></td>
<td valign="middle" width="245" style="border-left-style: none; border-left-width: medium; border-top-style: solid; border-top-width: 1px; border-bottom-style: solid; border-bottom-width: 1px; border-right-style:none; border-right-width:medium">
<font face="Verdana" size="2">' .$description. '</font></td>
<td valign="middle" width="118" style="border-left-style: none; border-left-width: medium; border-top-style: solid; border-top-width: 1px; border-bottom-style: solid; border-bottom-width: 1px; border-right-style:none; border-right-width:medium">
<p align="center"><font face="Verdana" style="font-size: 8.5pt">$' .$units_per_product. '</font></td>
<td valign="middle" width="79" style="border-left-style:none; border-left-width:medium; border-right-style:none; border-right-width:medium; border-top-style:solid; border-top-width:1px; border-bottom-style:solid; border-bottom-width:1px">
<p align="left"><font face="Verdana" style="font-size: 8.5pt"> $' .$unit_price. ' </font></td>
<td valign="middle" width="93" style="border-top-style: solid; border-top-width: 1px; border-bottom-style: solid; border-bottom-width: 1px; border-left-style:none; border-left-width:medium; border-right-style:none; border-right-width:medium">
<p align="left"><font face="Verdana" style="font-size: 8.5pt"> $' .$product_price. '</font></td>
<td width="56" style="border-left-style:none; border-left-width:medium; border-right-style:none; border-right-width:medium; border-top-style:solid; border-top-width:1px; border-bottom-style:solid; border-bottom-width:1px" valign="middle">
<p align="right"> <font face="Verdana" size="1">Qty: </font></td>
<td height="45" width="87" style="border-left-style: none; border-left-width: medium; border-right-style: solid; border-right-width: 1px; border-top-style: solid; border-top-width: 1px; border-bottom-style: solid; border-bottom-width: 1px">
<form><p align="center">
<input name="' .$id. '" size="1" value="' .$qty. '" style="float: left">
</form></p> </td>
</tr>
</table>
</div>
<div align="center">
<table cellpadding="0" cellspacing="0" width="779" height="3">
<!-- MSTableType="layout" -->
<tr>
<td width="779" height="3"></td>
</tr>
</table>
</div>';
}
} else {
$list = "";
}
mysql_close();
?>Screenshot:
http://www.malloukcompany.com.au/1.png

