Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Help using ob_start


Trout69

Recommended Posts

Posted

HI All,

 

I'm having a header error taht i just cannot fix, i'm not a coder and after staring endlessly at the code trying to move things arround i have acheived nothing but more errors. I've been told that if i use the ob_start function then this will clear the error, although tho it is not a very desirable solution. unfortunately i have no choice as i cannot fix the error any other way.

 

I was hoping someone could tell me where to put ob_start to make it work? The first 40 lines of my code are below

 

<?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>

 

Please please please can someone help me?

 

Best Regards

 

Donna

Posted

And the error would be...

Please use the forums for support! I am happy to help you here, but I am unable to offer free technical support over instant messenger or e-mail.

Posted
And the error would be...

 

Its the:

 

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/functions/general.php on line 33

 

Apologies, i thought i had mentioned this...

 

Regards

 

Donna

Posted

All ob_start will do is absorb the error so that it doesn't display -- it won't fix your problem. Whatever is one line 28 of your modules.php file (which isn't apart of OSC) is what's causing the problem. Post line 28 along with a few lines above and after it so that we can see what's going on.

Please use the forums for support! I am happy to help you here, but I am unable to offer free technical support over instant messenger or e-mail.

Posted
All ob_start will do is absorb the error so that it doesn't display -- it won't fix your problem. Whatever is one line 28 of your modules.php file (which isn't apart of OSC) is what's causing the problem. Post line 28 along with a few lines above and after it so that we can see what's going on.

 

Its part of the phpBB contribution, which is lightly buggy to say the least....lol...

 

here we go:

 

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>

 

This starts on line 24, i understand that content cannot be sent before the headers, but do not understand what part is content and what part is headers, i;ve tried moving some lines around but the header error still appears, just on another line....is this just a poor piece of code supplied with the contribution?

 

Best Regards

 

Donna

Posted
Its part of the phpBB contribution, which is lightly buggy to say the least....lol...

 

here we go:

 

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>

 

This starts on line 24, i understand that content cannot be sent before the headers, but do not understand what part is content and what part is headers, i;ve tried moving some lines around but the header error still appears, just on another line....is this just a poor piece of code supplied with the contribution?

 

Best Regards

 

Donna

 

maybe add a closing bracket there :

 

if (( $mode != 'smilies' ) & ( $mode != 'topicreview' ) & ( $mode != 'searchuser' )) {

define('SHOW_HEAD_FOOT', true);

}

Treasurer MFC

Posted

<html <?php echo HTML_PARAMS; ?>

 

 

The html tag misses a closing > .

 

Maybe this does the trick?

 

abra

The First Law of E-Commerce: If the user can't find the product, the user can't buy the product.

 

Feedback and suggestions on my shop welcome.

 

Note: My advice is based on my own experience or on something I read in these forums. No guarantee it'll work for you! Make sure that you always BACKUP the database and the files you are going to change so that you can rollback to a working version if things go wrong.

Posted

HI There,

 

I've changed both things as advised, but now i get the following error:

 

Parse error: parse error, unexpected T_DEFAULT in /home/dtotrans/public_html/ladyloving/modules.php on line 64

 

Line 64 of the code is were default is:

 

<?php
}
  include(DIR_WS_MODULES."$name/$file"); 

//Footer data em page_tail

  break; 

default:
die("Sorry file does't exist.");
break;
exit;
}
?>

 

Regards

 

Donna

Posted

These error messages usually mean that there is a closing } or ; missing somewhere before the parser reaches the unexpected "thing".

 

abra

The First Law of E-Commerce: If the user can't find the product, the user can't buy the product.

 

Feedback and suggestions on my shop welcome.

 

Note: My advice is based on my own experience or on something I read in these forums. No guarantee it'll work for you! Make sure that you always BACKUP the database and the files you are going to change so that you can rollback to a working version if things go wrong.

Posted

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/functions/general.php on line 33

 

Almost always to my mind this error is caused by whitespace before the opening php tag (<?php)

Posted

thunderarce,

 

it seems we moved on from the original header error to

 

Parse error: parse error, unexpected T_DEFAULT in /home/dtotrans/public_html/ladyloving/modules.php on line 64

 

I don't think this error would appear if the parser still gets stuck with whitespace.

 

abra

The First Law of E-Commerce: If the user can't find the product, the user can't buy the product.

 

Feedback and suggestions on my shop welcome.

 

Note: My advice is based on my own experience or on something I read in these forums. No guarantee it'll work for you! Make sure that you always BACKUP the database and the files you are going to change so that you can rollback to a working version if things go wrong.

Posted
thunderarce
interesting ..

 

Well that's fine but I think you need to solve the initial problem "correctly" otherwise the following errors may be children.

Posted
interesting ..

 

Well that's fine but I think you need to solve the initial problem "correctly" otherwise the following errors may be children.

 

This is definately not a whitespace error, i'm sure i mentioned this in my original post? I just don't know what to do with this file, its driving me crazy...lol!!

 

Donna

Posted
This is definately not a whitespace error, i'm sure i mentioned this in my original post? I just don't know what to do with this file, its driving me crazy...lol!!

 

Donna

 

Apologies, i didnt mention this...lol, i've been trying to get advise in somany places over this that i just don't know what i've said where....it has to be a problem with Line 28, as after i remove all the parse errors, the error returns back to that line...

 

Best Regards

 

Donna

Posted

Post the code around line 28 and identify line 28 itself.

 

I'm imagining it to be ..

 

<html <?php echo HTML_PARAMS; ?>>

Posted
Post the code around line 28 and identify line 28 itself.

 

I'm imagining it to be ..

 

<html <?php echo HTML_PARAMS; ?>>

 

That is indeed line 28...and the code around this line was posted in reply #5

 

Donna

Posted

Donna

 

I know that you posted the lines in post 5, but you are still saying that the error is still line 28.

 

In your post no 5 your line 28 reads ..

 

<html <?php echo HTML_PARAMS; ?>

 

not

 

<html <?php echo HTML_PARAMS; ?>>

 

I also know that abra pointed this out earlier, but it seems odd to have an error there when the code should be pure osC

Posted
Donna

 

I know that you posted the lines in post 5, but you are still saying that the error is still line 28.

 

In your post no 5 your line 28 reads ..

 

<html <?php echo HTML_PARAMS; ?>

 

not

 

<html <?php echo HTML_PARAMS; ?>>

 

I also know that abra pointed this out earlier, but it seems odd to have an error there when the code should be pure osC

 

suggest to post the complete page code instead of chasing code fragments.

Treasurer MFC

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...