Hello,
I have an error on multiple pages which looks much like this. If anyone can help that would be gratefully appreciated. I would also like to ask if you may give me an explanation as to why it is occurring and not just a solution. Also when I take the second header out the error disappears.
Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\blog\blog_display_post.php:47) in C:\xampp\htdocs\blog\comments.php on line 49
Here is my code:
if(strlen($email) > 5){
mysqli_query($con, "INSERT INTO emails (email) VALUES ('$email')");
mysqli_query($con, "INSERT INTO comments (com_name, com_com, com_date, com_blog) VALUES ('$name', '$comment', '$date', '$postid')");
header("Location: index.php");
}else{
mysqli_query($con, "INSERT INTO comments (com_name, com_com, com_date, com_blog) VALUES ('$name', '$comment', '$date', '$postid')");
header("Location: index.php");
}
}
}