Version: , by (Guest)
Developer Last Online: Jan 1970
Version: Unknown
Rating:
Released: 12-24-2000
Last Update: Never
Installs: 0
No support by the author.
Does anyone know why it gives me this error right above my news?
Code:
Warning: Cannot add header information - headers already sent by (output started at /www/egamers/index.php:14) in global.php on line 755
Warning: Cannot add header information - headers already sent by (output started at /www/egamers/index.php:14) in global.php on line 758
It only says that if the user hasn't logged in yet.
Could anyone help me?
I've tried e-mailing AC-3, but I didn't get a reply, so I'm going to try asking here, to see if anyone else could help.
Show Your Support
This modification may not be copied, reproduced or published elsewhere without author's permission.
You can't set or change headers or cookies after any content whatsoever is sent to the browser. This can be as small as a single space above your opening PHP tag. Without looking at your entire code, I couldn't tell you what is exactly wrong but it appears to be that you are trying to set the cookies after you display the screen.
Here is the code I use for the weblog system and it works just fine.
Code:
<?php
require("global.php");
// Newsforum -- The forum that the script will pull news headlines from. Unless you want all
// your users to be able to update your news, you may want to consider limiting this forum to
// Moderators posting new threads...this is easily done via the vB control panel.
$newsforum = 11;
// News Limit -- How many stories should be displayed?
$bfc_newslimit = 5;
$isnews = 1;
$newsbits="";
$threads=$DB_site->query("SELECT * FROM thread WHERE forumid=$newsforum ORDER BY dateline DESC LIMIT $bfc_newslimit");
while ($thread=$DB_site->fetch_array($threads)) {
$postdate=date($dateformat,$thread[dateline]+(($timeoffset+$bbtimezoneoffset)*3600));
$posttime=date($timeformat,$thread[dateline]+(($timeoffset+$bbtimezoneoffset)*3600));
$replycount=$thread[replycount];
$username=$thread[postusername];
$newstitle=$thread[title];
$threadid=$thread["threadid"];
if ($replycount == "0") {
$replies = "";
}
elseif ($replycount == "1") {
$replies = "| (1 Comment)";
}
else {
$replies = "| ($replycount Comments)";
}
$posts=$DB_site->query("SELECT post.userid, pagetext,user.username as username
FROM post LEFT JOIN user ON (post.userid = user.userid)
WHERE threadid=$threadid ORDER BY postid LIMIT 1");
$postinfo=$DB_site->fetch_array($posts);
$userid=$postinfo[userid];
$username=$postinfo[username];
//$dept=$postinfo[dept],
//$category=$posts[category];
$message=bbcodeparse($postinfo[pagetext],$forumid,1);
eval("\$newsbits .= \"".gettemplate("newsbit")."\";");
}
eval("echo dovars(\"".gettemplate("news")."\");");