Error: “Cannot modify header information”
The error that I have is a very common error. Yet I saw that the error message is different per person. The message I am getting is:
array(4) { [“type”]=> int(2) [“message”]=> string(171) “Cannot modify header information – headers already sent by (output started at /home/radioprog/domains/radioprogrammabank.nl/public_html/wp/wp-includes/formatting.php:5688)” [“file”]=> string(145) “/home/radioprog/domains/radioprogrammabank.nl/public_html/wp/wp-content/plugins/insert-php-code-snippet/shortcode-handler.php(65) : eval()’d code” [“line”]=> int(61) }
When I change themes (twenty nineteen), the error does not go away. It simply changes to:
array(4) { [“type”]=> int(2) [“message”]=> string(175) “Cannot modify header information – headers already sent by (output started at /home/radioprog/domains/radioprogrammabank.nl/public_html/wp/wp-includes/class.wp-styles.php:287)” [“file”]=> string(145) “/home/radioprog/domains/radioprogrammabank.nl/public_html/wp/wp-content/plugins/insert-php-code-snippet/shortcode-handler.php(65) : eval()’d code” [“line”]=> int(61) } upload is gelukt
I tried to go to the formatting.php and changing what was wrong, but it did not solve my problems.
I have a header()
function that needs to redirect people to another page. When I var_dump
it. The first error is shown. I want the error to go away so that I can redirect visitors to a different page using the header()
function
shortcode-handler.php (line 55 – 75):
}
$content_to_eval='?>'.$content_to_eval;
}
/***** to handle old codes : end *****/
else{
if(substr(trim($content_to_eval), 0,5)=='<?php')
$content_to_eval='?>'.$content_to_eval;
}
eval($content_to_eval);
$xyz_em_content = ob_get_contents();
// ob_clean();
ob_end_clean();
return $xyz_em_content;
/* }
else{
eval($sippetdetails->content);
}*/
}
else{
Leave an answer