您可以將popup事件關閉。在your_popup.php
profil.php
<button type="button" id="delete" onclick="window.open('your_popup.php', 'popup', 'height=400, width=400, top=0, left=0,resizable=yes,scrollbars=yes,toolbar=yes,menubar=no')">Delete</button>
然後:你可以做這樣的事情
<?php
if(isset($_POST['confirm_delete'])) {
// do you query or database delete, etc.
// at the end
echo '<script type="text/javascript">self.close(); opener.location.href = "http://localhost/citate_celebre/profil.php";</script>';
}
?>
<form method="POST" action="popup.php">
<button type="button" id="cancel_delete">Cancel</button>
<button type="submit" name="confirm_delete">Delete</button>
</form>
非常有益的!謝謝! – Filip