Php 标头已在LIVE server上发送错误消息
在将我的PHP项目上传到实时服务器之后,我在访问某些页面时收到了此错误消息 警告:无法修改标题信息-标题已由发送 (输出开始于 /home/mychoice/public_html/version-2/dashboard/includes/header.inc.html:14) 在里面 /home/mychoice/public\u html/version-2/dashboard/modules/\u modify\u admin\u select.inc.php 第63行 但是当在localhost上运行时,我没有收到这个错误,并且每个脚本都正常工作 我已经检查了空格、PHP开始-结束标记和没有BOM的编码 但我还是不明白 这是我的Php 标头已在LIVE server上发送错误消息,php,html,http-headers,Php,Html,Http Headers,在将我的PHP项目上传到实时服务器之后,我在访问某些页面时收到了此错误消息 警告:无法修改标题信息-标题已由发送 (输出开始于 /home/mychoice/public_html/version-2/dashboard/includes/header.inc.html:14) 在里面 /home/mychoice/public\u html/version-2/dashboard/modules/\u modify\u admin\u select.inc.php 第63行 但是当在local
header.inc.html
页面:
<?php # -- header.html
// This page begins the HTML header for the site.
// Check for a $page_title value:
if (!isset($page_title)) $page_title = 'Computer store | Control Panel';
?><!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title><?php echo $page_title; ?></title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/ico" href="favicon.ico"/>
<link rel="apple-touch-icon" sizes="152x152" href="apple-touch-icon-precomposed.png" />
<link rel="stylesheet" href="css/styles.css">
<script src="js/vendor/modernizr.min.js"></script>
</head>
<body>
<!--[if lt IE 7]>
<p class="browsehappy">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p>
<![endif]-->
<!-- End of header. -->
尝试使用javascript而不是标头
<script>
vax x='index.php';
window.location.href=x;
</script>
vax='index.php';
window.location.href=x;
@Dagon。在我问这个问题之前,我检查了这个问题,并根据那里提供的答案尝试了几乎所有的方法。但它在localhost中工作,但在live server中不工作。我看到很多输出,并且没有对header的调用。@Dagon,请您解释一下您最后的评论。其实我不知道你说了什么。提前谢谢。我已经用UTF-8保存了这个文件,没有BOM
。我还尝试删除该文件中的所有PHP
。但是我仍然可以得到错误信息。在你发布的代码中没有使用标题