我的代碼 - 發送不能更改頭信息 - 頭已經被錯誤
if ($result)
{
$row = $result->fetch_object();
$filename = $row->src;
$q = "delete from photos WHERE id=$fileid";
$result = $mysqli->query($q) or die(mysqli_error($mysqli));
if ($result)
{
$filepath = "./images/";
if(fileDelete($filepath,$filename))
{
echo "success";
header("Location: index.php");
exit;
}
else echo "failed";
}
}
輸出 -
success Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\pics\deletepic.php:31) in C:\xampp\htdocs\pics\deletepic.php on line 32
可能的重複:http://stackoverflow.com/questions/1827314/cannot-modify-header-information-headers-already-sent-why-its-happening http://stackoverflow.com/questions/3109141/cannot -modify-header-information-headers-already-sent-by http://stackoverflow.com/questions/1912029/warning-cannot-modify-header-information-headers-already-sent-by-error還有更多。 – 2010-08-02 11:04:29
只是擺脫無用的'回聲「成功」;'和'回聲「失敗」;' – 2010-08-02 11:08:06
-1在谷歌鍵入您的確切標題給出+/- 43mio結果... – 2010-08-02 11:08:12