in the last cell i want an input box, it not working?
you can see the outcome here: click here
function chooser() {
/ puts up a form to choose from a list of products
The products have to be stored in a comma-separated file
with the structure (Product,Product URL, Description,Price).
The form posts to a page "addToBasket.php3".
$fname is the name of the file.
/
global $table_products, $table_basket;
#-- output the column headers -->
?>
<FORM METHOD="POST" ACTION="addToBasket.php3">
<TABLE border = 1> <TR>
<TD ALIGN="center"> <em>Product</TD>
<TD ALIGN="center"> <em>Description</TD>
<TD ALIGN="center"> <em>Price</TD>
<TD ALIGN="center"> <em>URL</TD>
<TD ALIGN="center"> <em>Image</TD>
<TD ALIGN="center"> <em>Qty ordered</TD>
</em></TR>
<?php
/ now work through the products file, creating a table with a
data entry field to contain the quantity ordered /
$dbcnx = myConnect();
$query = "SELECT PROD_ID, PROD_NAME, PROD_PRICE, PROD_URL, PROD_IMAGE FROM $table_products";
$result=mysql_query($query);
if (! $result) {
printf ("Error: %s<br>", mysql_error ());
exit;
}
for ($i = 0; $i < mysql_num_rows ($result); $i++) {
$row = mysql_fetch_row($result);
echo("<tr>");
for($j = 0 ; $j<mysql_num_fields($result); $j++) {
echo("<td>");
if($j==3) { echo "<a href=\"".$row[$j]."\" target=\"_blank\">".$row[$j]."</a>";
}
elseif($j==4) {
echo "<img src=\"".$row[$j]."\">";
}
elseif ($j==5) {
echo("<TD><INPUT TYPE=TEXT NAME=QUANTITY[");
echo($row[0]);
echo("] SIZE=3></tr>");
}
else {
echo($row[$j]);
}
echo("</td>");
}
}
?>
</TABLE>
<INPUT TYPE=SUBMIT VALUE="Submit Form">
<INPUT TYPE=RESET VALUE="Reset Form">
</FORM>