Php 无法修改标题信息-标题
当我点击超链接时,我收到以下警告。我遵循了这个链接中给出的解决方案:但我无法让我的代码正常工作。它仍然会给我警告,并且不会重定向到下一页,即Php 无法修改标题信息-标题,php,html,Php,Html,当我点击超链接时,我收到以下警告。我遵循了这个链接中给出的解决方案:但我无法让我的代码正常工作。它仍然会给我警告,并且不会重定向到下一页,即remove\u from\u cart.php中给出的页面。请提供任何建议 警告:无法修改标题信息-第4行D:\remove\u from\u cart.php中已由发送的标题(输出从D:\index.php:188开始) 代码 <a href="index.php?page=remove_from_cart&action=remove&am
remove\u from\u cart.php
中给出的页面。请提供任何建议
警告:无法修改标题信息-第4行D:\remove\u from\u cart.php中已由发送的标题(输出从D:\index.php:188开始)
代码
<a href="index.php?page=remove_from_cart&action=remove&id=<?php echo $row['productid']; ?>">X</a>
从\u cart.php中删除\u
<?php
$id = isset($_GET['id']) ? $_GET['id'] : "";
unset($_SESSION['cart'][$id]);
header('Location: index.php?page=cart&id='.$id );
?>
更改此选项
echo "Removed id:".$id;//you cannot echo here
header('Location: index.php' );
到
好 啊!!但它不会指向提供的标题。它给出了上面提到的警告。仍然存在错误??让我们。@fred我已经提到这个链接对我没有帮助。
header('Location: index.php?id='.$id );
exit();// good practice to exit after header().