Your php script would contain a query to delete the comment
mysql_query("delete from comments where id = $id");
Send a request using Ajax which won't reload the current webpage. Here is a snippet using jQuery
function deleteComment(commentId)
{
$.ajax({
type: "POST",
url: "delete.php",
data: "id="+ commentId,
success: function(msg){
alert( "Comment " + commentId + " deleted" );
}
});
}
<a href="#" onclick="deleteComment(1)">Delete Comment 1</a>
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…