<?php include_once "header.php" ?>
<?php

  $arr = $_POST["id"];
  foreach ($arr as $val){    
      // UPDATE MAIL AS READ
      $sql = "DELETE FROM MAILBOX
               WHERE ID      =:mailid 
                  OR PARENTID=:parentid
             ";
      $stmt = $DB_con->prepare($sql);
      $stmt->bindparam(":mailid",   $val);
      $stmt->bindparam(":parentid", $val);
      $stmt->execute();
  }
  
  header("location: mailbox.php?success=2");

?>
<?php include_once "footer.php" ?>