I have a form that's built with a query. It has a checkbox where the processing page is supposed to delete the records that were checked. I've tried passing an ARRAY for the checkbox field that includes the hidden field values in the array (key fields needed for delete query), but when I view the ARRAY Keys the two fields are together and I need to test them separately.
Here's sample code from the PHP FORM with the ARRAY that is sent:
[CODE]
While (OCIFetch($stmt))
{
$field_6 = OCIResult($stmt, 'SUBJECT');
$fmUser = OCIResult($stmt, 'FROMUSER');
$msgID = OCIResult($stmt, 'MESSAGEID');
$usrID = OCIResult($stmt, 'USERID');
echo "<tr class=\"unread\">";
echo "<td> <input type=\"text\" name=\"\" value=\"$msgID\"></td>";
echo "<td>";
echo "<td> <input type=\"text\" name=\"\" value=\"$usrID\"></td>";
echo "<td>";
echo "<td>";
echo "</tr>";
echo "<tr class=\"unread\">";
echo "<td> <input type=\"checkbox\" name=\"delete['$msgID','$usrID']\"</td>";
echo "<td>";
//get_sender_name($fmUser,$conn);
echo "$fmUser";
echo "</td>";
echo "<td><font color=\"#FFFFFF\"><a href=\"message_ng.htm\">$field_6</a></font></td>";
echo "</tr>";
}
[/CODE]
The PHP file that processes the FORM follows:
[CODE]
<?php
$post_array = $_POST['delete'];
reset($post_array);
while ($array_cell = each($post_array))
{
$current_key = $array_cell['key'];
$current_value = $array_cell['value'];
echo "Key: $current_key; Value: $current_value";
echo "<br>";
}
?>
[/CODE]
As a test, the PHP file above that will process the FORM is set to just display the ARRAY content now.
Any assistance is appreciated,
Thanks!