I know this will be a simple solution but I am having a hard time figuring it out. I have a list of items generated from a sql query and a While loop.
Each item has 3 choices i.e. ORDER, COMPLETE, EDIT. When the user selects the choice the page submits to itself and isset() determines which was submitted. My problem seems to be in the way the submit buttons are being handled and the form information is being passed. This probably has to be handled with an array but I am just not figuring it out. Pease see the code snippet, any suggestions as to a solution would be appreciated.
while ($get_info = mysql_fetch_array($services))
{
$trcolor = usecolor();
echo "<tr BGcolor=$trcolor Valign=Top>";
$aStatus = $get_info["status"];
$aType = $get_info["type"];
$assigned = $get_info["assigned_to"];
$aCondition_Number = $get_info["condition_number"];
$aCondition = $get_info["name"];
$aCondid = $get_info["condid"];
$aComment = $get_info["comment"];
$aorder_date = $get_info["order_date"];
$arcvd_date = $get_info["rcvd_date"];
$aCreated_Date = $get_info["created_date"];
list ($aOrdery, $aOrderm, $aOrderd) = split ('[-]', $aorder_date);
list ($aRcvdy, $aRcvdm, $aRcvdd) = split ('[-]', $arcvd_date);
<td width=5% CLASS=<? echo $aStatus ; ?>><input type=checkbox name="Complete" value="<? echo $aCondid ; ?>">
<td width=5% CLASS=<? echo $aStatus ; ?>><input type=submit name="Order" value="<? echo $aCondid ; ?>">
<td width=15% CLASS=<? echo $aStatus ; ?>><b><? echo $aCondition ; ?></b>
<td width=20% CLASS=<? echo $aStatus ; ?>><? echo $vendor ;?>
<td width=20% CLASS=<? echo $aStatus ; ?>><input type=text name="comment">
<td width=10% CLASS=<? echo $aStatus ; ?>><? echo $aOrderm ; ?>/<? echo $aOrderd ; ?>/<? echo $aOrdery ; ?>
<td width=10% CLASS=<? echo $aStatus ; ?>><? echo $aRcvdm ; ?>/<? echo $aRcvdd ; ?>/<? echo $aRcvdy ; ?>
<td width=5%><input type=submit name="Order" value="<? echo $aCondid ; ?>">
<input type='hidden' name='aid' value='<? echo $aid ; ?>'>
<input type='hidden' name='service' value='<? echo $aCondition ; ?>'>
<input type='hidden' name='cond_id' value='<? echo $aCondid ; ?>'>
I have tried several differnt ways of "submitting" the desired request, and it works accept that the information passed is always the same. It is the info for the last row, no matter which row is submitted. As I said any help would be apprecited. It is not necessary to fix my code, just an example of how to do something similar will suffice. Thanks in advance.