Hi robkir,
just an idea,
why dont you instead of keeping a submit button for each row , keep a check box and keep all inside a form. so this way u only need to have one submit button. make sure you name the checkbox with as array.
check out the example below,
<table width="100%" border="0">
<tr>
<td><form id="form1" name="form1" method="post" action="">
<table width="100%" border="0">
<tr>
<td><label>
<input type="checkbox" name="chkdel[]" value="<?=$contact['id'];?>" />
contact one</label></td>
</tr>
<tr>
<td><input type="checkbox" name="chkdel[]" value="<?=$contact['id'];?>" />
contact two</td>
</tr>
<tr>
<td><input type="checkbox" name="chkdel[]" value="<?=$contact['id'];?>" />
contact three</td>
</tr>
<tr>
<td><input type="checkbox" name="chkdel[]" value="<?=$contact['id'];?>" />
contact four</td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td><input type='submit' name = 'choice' value='Delete Entry'/></td>
</tr>
</table>
</form>
</td>
</tr>
</table>
make sure each row get added dynamically with relevant contact ID.
now you can check the items you want to delete and it can be handle in php as below,
if(is_set($_POST['chkdel']) && is_array($_POST['chkdel']))
{
while(list($key, $val) = each($_POST['chkdel']))
{
$itemToDelete = $val;
}
}
Hope this would help you.
Thanks,
Niro