Trout69 Posted March 30, 2006 Posted March 30, 2006 HI All, Now i know this is a common problem, but i have read many posts and most solutions are the same, but i cannot seem to locate the problem. The error reads as: Warning: Cannot modify header information - headers already sent by (output started at /home/dtotrans/public_html/ladyloving/modules.php:28) in /home/dtotrans/public_html/ladyloving/includes/modules/phpbb2/viewtopic.php on line 555 Now i have checked all the normal files for white spaces before the <php? and after the ?> and deleted any. The error message did change to pick up a different file as the problem, but now im stuck... Basically, the first line always mentions modules.php, so i've been looking through the file and cannot find anything that is causing the problem? What does the numer 28 mean after modules.php? If it means the line then here is an extraction from that line: 24 if (( $mode != 'smilies' ) & ( $mode != 'topicreview' ) & ( $mode != 'searchuser' )) { 25 define('SHOW_HEAD_FOOT', true); 26 ?> 27 <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN"> 28 <html <?php echo HTML_PARAMS; ?>> 29 <head> 30 <meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>"> 31 <title><?php echo TITLE; ?></title> Now i also checked viewtopic.php and line 555 looks like this: 551 } 552 553 $tracking_topics[$topic_id] = time(); 554 555 setcookie($board_config['cookie_name'] . '_t', serialize($tracking_topics), 0, $board_config 556 ['cookie_path'], $board_config['cookie_domain'], $board_config['cookie_secure']); 557 } But im not sure what can be the problem here either? I've checked configure.php for blanks spaces already so i don't really know what else to do? If there is a rougue space/line will it linked to the page i am trying to view? Or cud it be completely un-related and still cause the problem? Thanks in advance Donna
Guest Posted March 31, 2006 Posted March 31, 2006 The problem is not only caused by whitespace. The 28 refers to the line number - the problem is most likely caused by the 'echo' being premature to the setcookie :) Here is a good explanation of the error message: http://www.phpbuilder.com/board/showthread...postid=10453971 Matti
Trout69 Posted March 31, 2006 Author Posted March 31, 2006 The problem is not only caused by whitespace. The 28 refers to the line number - the problem is most likely caused by the 'echo' being premature to the setcookie :) Here is a good explanation of the error message: http://www.phpbuilder.com/board/showthread...postid=10453971 Matti Hi Matti, Thanks for your response, i've read about the problem as per your intructions, but the soloutins are quite technical and far beyond my knowledge of php. Is there an easy way to prevent this happening? The only modification to the code, i beleive, was when i installed the phpbb contribution, so there is possibly an error derived from that? Best Regards Donna
Guest Posted March 31, 2006 Posted March 31, 2006 Yes - it wants to set a cookie (header info) after you have already sent content to the browser - this should be called before any html, in this case the echo. Matti
Trout69 Posted March 31, 2006 Author Posted March 31, 2006 Yes - it wants to set a cookie (header info) after you have already sent content to the browser - this should be called before any html, in this case the echo. Matti Thanks Matti, Apologies for being slightly dumb on this, just on my way home from work in a sec, so will try fix it when i get home. Regards Donna :thumbsup:
Trout69 Posted March 31, 2006 Author Posted March 31, 2006 Thanks Matti, Apologies for being slightly dumb on this, just on my way home from work in a sec, so will try fix it when i get home. Regards Donna :thumbsup: Oh i really cant figure it out, i've looked at other files that i know are working and they all look pretty much the same with regards to the location of the echo and the html tag. I know its good to figure things out personally, but i've had so mnay isues to solve (and solved all but this with very little help, i've even managed to trouble shoot some SQL queries, which is way over my head) but with this i just can't see the wood for the tree's. I appreciate all youv'e done, and this will obviously be part of my learning curve, but could you possibly have a look at the code below (the first 42 lines from the modules.php file) <?php /* $Id: privacy.php,v 1.19 2002/07/21 23:38:57 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2002 osCommerceReleased under the GNU General Public License Integrate PHPBB206 INTO OSC 2.2 oscphpbb2 Copyright (c) 2003/09/10 version: 1.0 author: Oldpa web site: http://oscphpbb2.ecart.com.tw http://oldpa.adsldns.org http://www.oldpa.com.tw */ require('includes/application_top.php'); require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_BB_INDEX); $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_BBMODULES, 'op=modload&name=phpbb2&file=index.php', 'NONSSL')); switch($op){ case"modload": if (( $mode != 'smilies' ) & ( $mode != 'topicreview' ) & ( $mode != 'searchuser' )) { define('SHOW_HEAD_FOOT', true); ?> <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN"> <html <?php echo HTML_PARAMS; ?>> <head> <meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>"> <title><?php echo TITLE; ?></title> <base href="<?php echo (getenv('HTTPS') == 'on' ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>"> <link rel="stylesheet" type="text/css" href="stylesheet.css"> </head> <body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0"> <!-- header //--> <?php require(DIR_WS_INCLUDES . 'header.php'); ?> <!-- header_eof //--> <!-- body //--> <table border="0" width="100%" cellspacing="3" cellpadding="3"> <tr> I appreciate if you do not have the time to do this however. Best Regards Donna
dcross02 Posted August 6, 2007 Posted August 6, 2007 I almost lost my mind on this problem. If you've tried all the whitespace solutions with no results, make sure the files in question are properly saved. I opened them in notepad and did a "save as". As soon I I did this, I noticed they were in UTF-8 format. So, I just save them in ANSI and I was good to go.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.