我的代码 - 发送不能更改头信息 - 头已经被错误
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