Welcome to Geeklog, Anonymous Sunday, December 22 2024 @ 12:32 pm EST

Geeklog Forums

Errors - headers already sent


Anonymous

Anonymous
Here are the errors: Warning: Cannot add header information - headers already sent by (output started at /home/pcgamers/public_html/games/index.php:9) in /home/pcgamers/public_html/system/lib-sessions.php on line 150 Warning: Cannot add header information - headers already sent by (output started at /home/pcgamers/public_html/games/index.php:9) in /home/pcgamers/public_html/system/lib-sessions.php on line 162 here is what my #9 line says: 9<?php include ("config.php"Wink;?> 10<?php 11require ('../lib-common.php'); 12$display .= COM_siteHeader(); 13$display .= COM_startBlock('Games'); 14echo $display; 15?>
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
The error message is caused by the line break between your lines 9 and 10. There's no need to use opening and closing php tags here - just write <?php include ("config.php"Wink; require ('../lib-common.php'); etc. And if you're trying to include Geeklog's config.php here, then you don't even need that line since lib-common.php already includes the config.php. bye, Dirk
 Quote

Anonymous

Anonymous
nope..im not including the Geeklog's config..here is the code i ended up with but still have those errors displaying: <? require ("config.php"Wink; require ('../lib-common.php'); $display .= COM_siteHeader(); $display .= COM_startBlock('Games'); echo $display; ?>
 Quote

Anonymous

Anonymous
Make sure there is nothing before the opening <?php .
 Quote

Status: offline

etegration

Forum User
Full Member
Registered: 02/20/02
Posts: 179
change it to read: 9<?php include ("config.php"Wink; 10require ('../lib-common.php'); 11$display .= COM_siteHeader(); 12$display .= COM_startBlock('Games'); 13echo $display; 14?> and line 14, after ?> there should be no blank space(s).
http://www.etegration.com.sg
http://www.itcow.com
http://www.ministryofhosting.com
 Quote

Anonymous

Anonymous
could you please to show us line 1-9
 Quote

Anonymous

Anonymous
Here is the whole thing: <html> <head> <title>Gamer's Project</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body bgcolor="#FFFFFF" text="#000000"> <? include ("config.php"Wink; require ('../lib-common.php'); $display .= COM_siteHeader(); $display .= COM_startBlock('Games'); echo $display; ?><form name="search" method="post" action="index.php?temp_view=search.php"><input type="text" name="searchstring" size="12"><input type="submit" name="Submit" value="Go"></form><?php require ("menusl.php"Wink; ?><p align="center"><br><?php if ($temp_view == ""Wink {require ("headlines.php"Wink; } if ($temp_view == "headlines.php"Wink {require ("headlines.php"Wink; } if ($temp_view == "games.php"Wink {require ("games.php"Wink; } if ($temp_view == "view_news.php"Wink {require ("view_news.php"Wink; } if ($temp_view == "view_reviews.php"Wink {require ("view_reviews.php"Wink; } if ($temp_view == "view_previews.php"Wink {require ("view_previews.php"Wink; } if ($temp_view == "view_cheats.php"Wink {require ("view_cheats.php"Wink; } if ($temp_view == "view_guides.php"Wink {require ("view_guides.php"Wink; } if ($temp_view == "guide.php"Wink {require ("guide.php"Wink; } if ($temp_view == "review.php"Wink {require ("review.php"Wink; } if ($temp_view == "preview.php"Wink {require ("preview.php"Wink; } if ($temp_view == "cheats.php"Wink {require ("cheats.php"Wink; } if ($temp_view == "search.php"Wink {require ("search.php"Wink; } if ($temp_view == "game_info.php"Wink {require ("game_info.php"Wink; } if ($temp_view == "pages.php"Wink {require ("pages.php"Wink; } if ($temp_view == "page.php"Wink {require ("page.php"Wink; } if ($temp_view == "post_comments.php"Wink {require ("post_comments.php"Wink; } if ($temp_view == "gallery.php"Wink {require ("gallery.php"Wink; } ?> <?php require ("menusr.php"Wink; $display2 .= COM_endBlock(); $display2 .= COM_siteFooter(true); echo $display2; ?></body> </html>
 Quote

Anonymous

Anonymous
i just removed all space after and before <? and ?>..same errors..
 Quote

Status: offline

Tony

Site Admin
Admin
Registered: 12/17/01
Posts: 405
Location:Urbandale, Iowa
These errors typically occur as a result of bad customizations. If errors occur after headers are sent you get these messages. Edit index.php and before it writes out the HTML for the page, put an exit; command. That will force execution to stop and the real problem will get dumped to the screen.---The reason people blame things on previous generations is that there's only one other choice.
The reason people blame things on previous generations is that there's only one other choice.
 Quote

Anonymous

Anonymous
and where do i put that command in my case?
 Quote

badguy

Anonymous
Try this: <?php include ("config.php"Wink; require ('../lib-common.php'); $display = COM_siteHeader(); $display .= COM_startBlock('Games'); echo $display; ?><form name="search" method="post" action="index.php?temp_view=search.php"><input type="text" name="searchstring" size="12"><input type="submit" name="Submit" value="Go"></ form><?php require ("menusl.php"Wink; ?><p align="center"><br><?php if ($temp_view == ""Wink {require ("headlines.php"Wink; } if ($temp_view == "headlines.php"Wink {require ("headlines.php"Wink; } if ($temp_view == "games.php"Wink {require ("games.php"Wink; } if ($temp_view == "view_news.php"Wink {require ("view_news.php"Wink; } if ($temp_view == "view_reviews.php"Wink {require ("view_reviews.php"Wink; } if ($temp_view == "view_previews.php"Wink {require ("view_previews.php"Wink; } if ($temp_view == "view_cheats.php"Wink {require ("view_cheats.php"Wink; } if ($temp_view == "view_guides.php"Wink {require ("view_guides.php"Wink; } if ($temp_view == "guide.php"Wink {require ("guide.php"Wink; } if ($temp_view == "review.php"Wink {require ("review.php"Wink; } if ($temp_view == "preview.php"Wink {require ("preview.php"Wink; } if ($temp_view == "cheats.php"Wink {require ("cheats.php"Wink; } if ($temp_view == "search.php"Wink {require ("search.php"Wink; } if ($temp_view == "game_info.php"Wink {require ("game_info.php"Wink; } if ($temp_view == "pages.php"Wink {require ("pages.php"Wink; } if ($temp_view == "page.php"Wink {require ("page.php"Wink; } if ($temp_view == "post_comments.php"Wink {require ("post_comments.php"Wink; } if ($temp_view == "gallery.php"Wink {require ("gallery.php"Wink; } require ("menusr.php"Wink; $display2 .= COM_endBlock(); $display2 .= COM_siteFooter(true); echo $display2; ?> ---Nothing but 'Net
 Quote

Anonymous

Anonymous
subj! config.php i was calling had 2 empty lines before and after <? and ?>..thank you for your help guys!
 Quote

All times are EST. The time is now 12:32 pm.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content