2013-07-25 81 views
-2

我再次得到这个错误,我再次尝试一切,但我不能找到解决方案

警告发送了头: - 头已经发出不能更改头信息在/home/pappu/public_html/forum/index.php(输出开始/home/xxxx/xxxx/forum/index.php:90)上线93警告:不能更改头信息 - 已经由(输出)

这里是我的index.php代码

<?php 
include_once("connect.php"); 
session_start(); 
?> 
<html> 
<head> 
<title>MyForum</title> 
<style type="text/css"> 
body { 
background-color: #333; 
margin-top: 150px; 
margin-right: 0px; 
margin-bottom: 0px; 
margin-left: 0px; 
} 
.content { 
background-color: #666; 
width: 960px; 
margin-right: auto; 
margin-left: auto; 
border-radius: 3px; 
-webkit-border-radius: 3px; 
-moz-border-radius: 3px; 
padding: 20px; 
} 
.content .categories { 
width: 700px; 
background-color: #333; 
border-radius: 3px; 
-webkit-border-radius: 3px; 
-moz-border-radius: 3px; 
margin: 0px; 
font-family: "Trebuchet MS", Arial, Helvetica, sans-serif; 
color: #FFF; 
} 
.categories .community_heading { 
font-family: "Trebuchet MS", Arial, Helvetica, sans-serif; 
font-variant: normal; 
text-transform: capitalize; 
color: #CCC; 
margin: 0px; 
padding-top: 7px; 
padding-right: 7px; 
padding-bottom: 7px; 
padding-left: 14px; 
font-size: 18px; 
font-weight: bold; 
} 
.content .categories hr { 
background-color: #666; 
height: 3px; 
border: 0px; 
width: 700px; 
margin: 0px; 
} 

.content .categories .cat_links { 
border-bottom-width: thin; 
border-bottom-style: solid; 
border-bottom-color: #000; 
padding-top: 7px; 
padding-right: 7px; 
padding-bottom: 7px; 
padding-left: 14px; 
font-size: 14px; 
color: #000; 
} 
.content .categories .cat_a { 
font-family: "Trebuchet MS", Arial, Helvetica, sans-serif; 
font-size: 18px; 
font-variant: normal; 
text-transform: capitalize; 
color: #777; 
text-decoration: none; 
} 
.content .categories .cat_a:hover { 
text-decoration: underline; 
color: #DDD; 
} 
.content .categories .desc { 
margin: 0px; 
font-family: "Trebuchet MS", Arial, Helvetica, sans-serif; 
font-size: 12px; 
font-weight: bold; 
color: #CCC; 
} 
</style> 
</head> 
<body> 
<?php 
if(!isset($_SESSION['password'])) 
{ 
include_once("Location:header.php"); 
} 
else 
{ 
header("Location:member.php"); 
} 
?> 
<div class="content"> 
<div class="categories"> 
<h3 class="community_heading">Community</h3> 
<hr /> 
<?php 
$query = "SELECT * FROM categories ORDER BY cat_id ASC"; 
$result = mysql_query($query) or die(mysql_error()); 
$categories = ""; 
if(mysql_num_rows($result) > 0) 
{ 
while($row = mysql_fetch_array($result)) 
{ 
$cat_id = $row['cat_id']; 
$cat_title = $row['cat_title']; 
$cat_desc = $row['cat_description']; 
$categories .=" 
<div class='cat_links'> 
<a href='view_category?cid=".$cat_id."' class='cat_a'>$cat_title</a> 
<p class='desc'>$cat_desc</p> 
</div>"; 
} 
echo $categories ; 
} 
else 
{ 
} 
?> 
</div> 
</div> 
</body> 
</html> 

回答

0

在包含输出到页面的任何代码后,您不能调用Header()。您需要重写您正在做的事情,因此Header()调用超出了所有HTML代码。

+0

那么,发出任何输出后你不能调用它,但你可以在服务器端代码后调用它。 – David

+0

是的,冲我的答案。我现在纠正了。 – Styphon

相关问题