Tartanpig Posted November 4, 2010 Share Posted November 4, 2010 I am getting the following warning messages at the top of the site page. The site has been running for 12 months without any problems. Anyone got some ideas how I can fix this problem? Warning: Cannot modify header information - headers already sent by (output started at /home/content/s/t/a/stacie1818/html/index.php:2) in /home/content/s/t/a/stacie1818/html/includes/functions/general.php on line 1227 Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /home/content/s/t/a/stacie1818/html/index.php:2) in /home/content/s/t/a/stacie1818/html/includes/functions/sessions.php on line 102 I would appreciate some guidance on a fix Thanks Link to comment Share on other sites More sharing options...
MrPhil Posted November 4, 2010 Share Posted November 4, 2010 Most likely your /index.php has been hacked. The error message says that file (/index.php) started some output to the browser at line 2. There should be nothing that produces output before the <!doctype line. Link to comment Share on other sites More sharing options...
Tartanpig Posted November 4, 2010 Author Share Posted November 4, 2010 Most likely your /index.php has been hacked. The error message says that file (/index.php) started some output to the browser at line 2. There should be nothing that produces output before the <!doctype line. Phil Thanks for getting back quickly. I cannot see anything unusual before the <!doctype see for yourself <?php /* $Id: index.php 1739 2007-12-20 00:52:16Z hpdl $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright © 2003 osCommerce Released under the GNU General Public License */ require('includes/application_top.php'); // the following cPath references come from application_top.php $category_depth = 'top'; if (isset($cPath) && tep_not_null($cPath)) { $categories_products_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_TO_CATEGORIES . " where categories_id = '" . (int)$current_category_id . "'"); $cateqories_products = tep_db_fetch_array($categories_products_query); if ($cateqories_products['total'] > 0) { $category_depth = 'products'; // display products } else { $category_parent_query = tep_db_query("select count(*) as total from " . TABLE_CATEGORIES . " where parent_id = '" . (int)$current_category_id . "'"); $category_parent = tep_db_fetch_array($category_parent_query); if ($category_parent['total'] > 0) { $category_depth = 'nested'; // navigate through the categories } else { $category_depth = 'products'; // category has no products, but display the 'no products' message } } } require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_DEFAULT); ?> <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN" Still looking for a solution???? Link to comment Share on other sites More sharing options...
MrPhil Posted November 4, 2010 Share Posted November 4, 2010 OK, is <?php the very first line of the file? Is there any character (including blanks and tabs) before the < character on that first line? If that's clean, in your browser View > Page source look carefully at the very top of the page. Is there anything before <!doctype ? Any error messages (appearing before the "Warning: Cannot modify header information -" message)? Anything that looks out of place? When you list code, please put it within [ code ] ... [ /code ] tags. Link to comment Share on other sites More sharing options...
Tartanpig Posted November 4, 2010 Author Share Posted November 4, 2010 OK, is <?php the very first line of the file? Is there any character (including blanks and tabs) before the < character on that first line? If that's clean, in your browser View > Page source look carefully at the very top of the page. Is there anything before <!doctype ? Any error messages (appearing before the "Warning: Cannot modify header information -" message)? Anything that looks out of place? When you list code, please put it within [ code ] ... [ /code ] tags. Thanks for the etiquete will use in future. <?php is on line 2 right at the start. Line 1 is blank. Would this cause the problem ? Link to comment Share on other sites More sharing options...
MrPhil Posted November 5, 2010 Share Posted November 5, 2010 Usually a blank line at the very beginning will cause a "500" (Internal Server) error, but perhaps your server is configured a bit differently. Definitely get rid of the blank line 1, as well as any trailing blank lines if they're there. Link to comment Share on other sites More sharing options...
Tartanpig Posted November 5, 2010 Author Share Posted November 5, 2010 Phil Moved the <?php to the first line and that has solved the problem. Well done and thanks Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.