I am getting following warning when i click on hyperlink. I followed solution given in this link: How to fix "Headers already sent" error in PHP But i can't get my code work. It still gives me the warning and does not redirect to next page i.e given in remove_from_cart.php
.Any suggestions please.
Warning: Cannot modify header information - headers already sent by (output started at D:\index.php:188) in D:\remove_from_cart.php on line 4
Code
<a href="index.php?page=remove_from_cart&action=remove&id=<?php echo $row['productid']; ?>">X</a>
remove_from_cart.php
<?php
$id = isset($_GET['id']) ? $_GET['id'] : "";
unset($_SESSION['cart'][$id]);
header('Location: index.php?page=cart&id='.$id );
?>