Thank you both for your responses. I have been working with both of your ideas. I have the following form. This pulls all items for a database and prints the following code for each item:
<tr>
<td height=\"21\" valign=\"top\"><b>
<input name = \"$itemId\" value=\"$value\" size=\"3\" /></td>
<td><font face=\"Times New Roman\" color=\"#990000\">$itemName </td>";
if($temperature == "Y") {
echo "<td><select name=\"$itemId - temperature\">
<option value=\"NA\">-- Select --</option>
<option value=\"BR\">Blood-Rare</option>
<option value=\"MR\">Medium-Rare</option>
<option value=\"M\">Medium</option>
<option value=\"MW\">Medium-Well</option>
<option value=\"WD\">Well Done</option>
</select></td>";
} else {
echo "<td>N/A<input type=\"hidden\" name=\"$itemId - temperature\" value=\"N/A\" /></td>";
}
echo "<td><b>$$total</b></td>
</tr>";
$arr[] = $total;
}
Originally, I used the following code to populate an array and session variable so the values can be used on a different page:
if(!empty($_POST)) {
foreach($_POST as $key => $value) {
if($key != "_submit_check" && $key != "button" && $key != "0" && $key != "") {
if(!empty($value)){
$arr[$key] = $value;
}
}
}
}
$_SESSION['order'] = $arr;
Is it possible to create a 2 dimensional array as you described, Nog Dog? I tried adding something like $arr2[$key] = $value, but it didn't work.
Any thoughts would be greatly appreciated. I am new to using arrays in this way.
Thanks!