First let me paste my code:
<table width="100%" cellpadding="0" cellspacing="0" style="border: 1px solid #c1c1c1;" id="box-table-a">
<tr>
<th width="34" scope="col"></th>
<th width="170" scope="col">Category Name</th>
<th width="170" scope="col">Details</th>
<th width="50" scope="col">Status</th>
<th width="90" scope="col">Added</th>
<th width="90" scope="col">Creator</th>
</tr>
<form method="post" id="formsubmit" name="formsubmit" action="<?php echo "./news.php?section=categoriesnews"; ?>">
<?php $query = mysql_query("SELECT * FROM `news-sections`");
while($row = mysql_fetch_array( $query )) {
$sid = $row['id'];
$status = $row['status'];
$name = $row['name'];
$details = $row['details'];
$addedby = $row['addedby'];
$addeddate = date("F j, Y", $row['addeddate']);
$status = str_replace("1", "<img src='./images/icons/action_check.gif' />", $status );
$status = str_replace("0", "<img src='./images/icons/action_delete.gif' />", $status );
$query2 = mysql_query("SELECT * FROM `users` where id = '$addedby'");
while($row2 = mysql_fetch_array( $query2 )) {
$addedby = $row2['username'];
}
echo " <tr>
<td width='34'><label><input type='checkbox' name='cid' id='cid' value='$sid'/></label></td>
<td><a href='./users.php?section=categoriesnews&do=edit&id=$sid'>$name</a></td>
<td>$details</td>
<td>$status</td>
<td>$addeddate</td>
<td>$addedby</td>
</tr>";
}
?>
<tr class="footer">
<td colspan="6">
<a href="#" class="edit_inline" onclick="document.getElementById('edit').submit();" >Edit</a>
<a href="#" class="delete_inline" onclick="document.getElementById('delete').submit();" >Delete</a>
<a href="#" class="approve_inline" onclick="document.getElementById('activate').submit();" >Activate</a>
<a href="#" class="reject_inline" onclick="document.getElementById('disable').submit();" >Disable</a>
</td>
</td>
</tr></table>
Now a picture:
What I am failing to understand is how I can use a form, have a checkbox next to each row of data with the value of the rowid, and then the user chooses what link to click. I am not sure how to process this. If I want to activate a row, how would I get my form to recognise that I have clicked “Activate” link to submit the form.