I have the code below to retrieve rows from a database where the username column matches the base directory name:
$username = basename(dirname(__FILE__));
$user
echo "<a href='deletepage.php?id=$someid'>X</a>";
create a page that with _GET['id']
parameter;
And on that page i.e. deletepage.php?id=15
$sql = "DELETE table FROM table WHERE id = ".(int)$_GET['id']
mysql_query($sql);
header("location: previoudpage.php");
You could just add a submit button linking to the same page like
while ($row = mysql_fetch_array($result)) { //loop
extract($row);
$html .= "<li><span style=\"font-family: verdana;\"><a href=\"{$link}\" target=\"_blank\">{$link}</a> <form action=\"{$_SERVER["PHP_SELF"]}\" method=\"post\">
<input type=\"hidden\" value=\"{link}\" name=\"Delete\" />
<input type=\"submit\" value=\"Delete\" />
</form></span> <span style=\"color:white; font-family: verdana;\">- {$notes}</span></li>";
}
Then in your page do something like
if (!empty($_POST["delete"])){
$query = "DELETE FROM links where link = '{$_POST["Delete"]}'";
mysql_query($query);
}
That's the basic idea of how I would do it