i have a page that displays a table of the the products purchased for an order. i want to use a drop down box so that you can change the status of the purchased product from processing to dispatched. I then have an update button that should submit all the products status.
I am however having trouble of knowing how i catch all the posts for each products status.
here is my code
Code: Select all
echo "<form id='dis' name='dis' method='post' action='dis-exec.php'>";
$results=getOrderdetails($id);
$nums = mysql_numrows($results);
$x=0;
while ($x<$nums){
$pid=mysql_result($results,$x,0);
$prname=mysql_result($results,$x,2);
$stock=mysql_result($results,$x,6);
$qty=mysql_result($results,$x,10);
$status=mysql_result($results,$x,11);
echo "<tr>";
echo "<td>$pid</td>";
echo "<td>$prname</td>";
echo "<td>$stock</td>";
echo "<td>$qty</td>";
echo "<td><select name='state'>
<option>$status</option>
<option>Dispatch</option>
</select></td>";
echo "</tr>";
echo "<input type='hidden' name='pid' value='$pid'>";
echo "<input type='hidden' name='orid' value='$oid'>";
$x++;
}
echo "</table>";
echo "<input type='submit' value='Update'>";
echo "</form>";
Code: Select all
foreach ($_POST as $value) {
echo "$value<br>";
}
gisler