File deletion confirmation

This is a deletion handler script. The filename is passed through the ‘text’ field via POST. The filename is checked and deleted.
Here is the question: how to confirm the deletion with the “Yes” and “No” buttons and delete? Thanks in advance)

<?php
$dir = "./gallery";
if(isset($_POST["submit"])) { $name=$_POST['del'];
unlink ($dir.'/'.$name);
print ' ' . $name;
}
?>

Answer 1, authority 100%

<?php
$dir = "./gallery";
if(isset($_POST['del'])){$name=$_POST['del'];}
if(isset($_POST["submit"])) { 
print("?!");
?>
<!-- index.php -    .  ,   $_POST['submit']  $_POST['del']-->
<form action="index.php" method="post">
<button type="submit" name="confirm_del" value="1"></button>
<button type="submit" name="confirm_del" value="0"></button>
<input type="hidden" name="del" value="<?=$_POST['del']?>" />
</form>
<?php
}
if(isset($_POST['confirm_del'])){
    if($_POST['confirm_del']==1){
        unlink ($dir.'/'.$name); 
        print '  ' . $name;
    }else{
        print '  ' . $name;
    }
}
?>