我收到Warning: Cannot modify header information
。在WAMP上测试源代码时,我没有收到这个错误。在某些PHP中也包含某些类,并根据需要调用操作html的函数。任何一个人都可以指向正确的方向吗?这是确切的错误和引用的文件。警告:无法修改GoDaddy上的标题信息,但不能修改
警告:不能更改头信息 - 已经 发送头(输出开始 /home/content/39/8810539/html/pagoda/view/header.php:2)在 /家庭/内容/39/8810539/html/pagoda/controller/login.php第9行
的login.php:
<?php
global $session;
global $view;
if (isset($_POST['login']))
{
if ($session->logIn($_POST["uname"],$_POST["password"]))
header("Location: $_SERVER[REQUEST_URI]");
else
$view->RenderMsg("Your username and/or password was incorrect.");
}
if (isset($_POST['logout']))
{
$session->logOut();
header("Location: $_SERVER[REQUEST_URI]");
}
?>
的header.php片段:
<head>
<link rel="stylesheet" type="text/css" href="<?php echo BASEPATH; ?>/view/css/homepageStyle.css" />
</head>
<div id="header">
<div id="banner">
Pagoda
</div>
<div id="login">
<?php
//This controls the login/logout header on the top of each page.
global $session;
if ($session->isLoggedIn())
{
?>
<div id="nametag">
<form method="POST" name="logout" action="">
Welcome, <?php echo $session->getName()." (".$session->getRole().")"?>
<input name="logout" type="hidden" value="Log Out"/>
</form>
</div>
....
....
....
您可以具有之前'
2012-02-11 05:39:14
这里有点尴尬,但如果我是你,我的第一笔生意将从可怕的GoDaddy托管服务中转移。 – rdlowrey 2012-02-11 05:40:00
请删除php文件中的尾部空格。 – Avinash 2012-02-11 05:47:15