【发布时间】:2013-08-07 09:57:48
【问题描述】:
我写成
<?php
if (isset($_POST['delete'])):
$size = count($_POST['checkbox']);
for ($i=0; $i<=$size-1; $i++) {
$id = $_POST['checkbox'][$i];
$wpdb->query("DELETE FROM wp_submitted_form WHERE id =".$id);
}
header('Location: http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
endif;
?>
当点击提交按钮时,它会抛出错误消息:
Cannot modify header information - headers already sent by (output started at /home/wizcorea/public_html/wp-admin/includes/template.php:1657) in /home/wizcorea/public_html/wp-content/plugins/submitted-form/view.php on line 54
我希望在单击提交按钮后刷新该页面
【问题讨论】:
-
如果您只花了 1 分钟时间搜索“标头已发送 php”,您会发现数以千计的结果,并且答案非常好。看这里:stackoverflow.com/search?q=headers+already+sent+php
标签: php wordpress http-headers