Return a small form with a "Are you shure to delete" where $msg is the actual message.
$link is the url where the "post" has to go to and $hidden contains additional hidden fields then you need.
The POST has defined 'confirm' on Yes and 'cancel' on No.
So if isset($_POST['confirm']) delete something else do something else
URL that has to be in the form "action=" parameter
the message to show
the additional hidden fields