I don't understand.
At first you say you want to designate an image for deletion using a checkbox, now you want to delete it using a link?
Well you can't use a POST variable for links - only GET variables. First of all check if the GET variable has anything in it. Id it does then take that ID number, plug into the SQL query then voila!
echo "<a href='delete.php?id=";
echo $id;
echo "'>Delete</a>";
This has the url of the page with the below code for deletion. The id number is dynamically creates for each file displays (there might be a list. If there is then you probably will want help with all of those. It probably includes a foreach loop or something.)
Now the deletion code on delete.php:
if (isset($_GET['id']))
{
$id = $_GET['id'];
$sql="DELETE FROM mytable WHERE id=$id";
mysql_query($sql, $db) or die($sql."<br />\n".mysql_error());
}
You can, however, have the above code on the same page you are using to select the file for deletion - just make sure the first code nippet points to the same page.
Basically - if a variable is in the URL upon loading, then something happens. If not then nothing happens.
If the ID is there, it deletes it. If not then it displays the list of deletable images.
However, me personally I try to never delete things. I prefer to have a column called 'show' and instead of deleting I set 'show' == '0' so that it would appear deleted.
Call it backup if you like!