?
Solved

PHP (PHPBB)

Posted on 2005-04-08
8
Medium Priority
?
241 Views
Last Modified: 2008-03-06
I have opened up the common.php file located in the phpbb2 folder, and
added:

include ('MyPHPFile.php');

As the first line, but I get warnings saying I can not alter the header
information when MyPHPFile.php runs. If necessary I can get the
error, but I am guessing the problem is with where I am including
the file. Where can I include the file with it still appearing on EVERY
page of the forum, without the errors?
0
Comment
Question by:List244
  • 5
  • 2
8 Comments
 
LVL 7

Expert Comment

by:Promethyl
ID: 13742512
The program error will tell you the conflicting line.

I would locate your include before this line in the index.php:
        include($phpbb_root_path . 'includes/page_header.'.$phpEx);

Or inside this page_header.php file.


0
 
LVL 17

Expert Comment

by:davebytes
ID: 13743979
Also make sure there are no blank lines or spaces or anything before the opening "<?php" on the page.  Any output will start generating the page, at which point header output will cause such errors.

-d
0
 
LVL 7

Expert Comment

by:Promethyl
ID: 13744040
THa'ts not his problem. The session and cookies are initialized right after the place where he put the include line. It was clearly a position choice which started the problem.
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 8

Author Comment

by:List244
ID: 13744343
test
Warning: Cannot modify header information - headers already sent by (output started at \\premfs18\sites\premium18\Visualcodec\webroot\forum\phpbb2\includes\MyPHPFile.php:2) in \\premfs18\sites\premium18\Visualcodec\webroot\forum\phpbb2\includes\page_header.php on line 477

Warning: Cannot modify header information - headers already sent by (output started at \\premfs18\sites\premium18\Visualcodec\webroot\forum\phpbb2\includes\MyPHPFile.php:2) in \\premfs18\sites\premium18\Visualcodec\webroot\forum\phpbb2\includes\page_header.php on line 479

Warning: Cannot modify header information - headers already sent by (output started at \\premfs18\sites\premium18\Visualcodec\webroot\forum\phpbb2\includes\MyPHPFile.php:2) in \\premfs18\sites\premium18\Visualcodec\webroot\forum\phpbb2\includes\page_header.php on line 480

This is the same error as before, except the include is now in the page_header.php
all that the line does is "<?php print "test"; ?>
0
 
LVL 7

Expert Comment

by:Promethyl
ID: 13744363
In that instance, put the include after line 480 in file page_header.php.

0
 
LVL 8

Author Comment

by:List244
ID: 13745458
I went down to like line 490 (That was the end of the whole 480 segment) and it gave me the SAME exact error.
Same lines and everything. However, I placed it at the end of the file, which was probably line 500, and things
worked fine, why is that?
0
 
LVL 7

Accepted Solution

by:
Promethyl earned 2000 total points
ID: 13745567
You've got me. I'd have to look at the code. I would say there are more lines which require no output to be sent after 480.

Good that we figured that out
0
 
LVL 7

Expert Comment

by:Promethyl
ID: 13745601
As an alertnative, btw... I think yhou could ob_start('gz_handler');

http://us2.php.net/manual/en/function.ob-gzhandler.php

This would allow you to put your line anywhere you'd like ! Additionally, it would be faster for viewers!
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
This article discusses how to create an extensible mechanism for linked drop downs.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Suggested Courses
Course of the Month15 days, 16 hours left to enroll

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question