Suggestion for Add a custom header/footer to Coppermine Suggestion for Add a custom header/footer to Coppermine
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

Suggestion for Add a custom header/footer to Coppermine

Started by xplicit, October 24, 2005, 11:24:36 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

xplicit

As a site developer I just stumbled into a thing I just want to share for those who perhaps have the same sort of behaviours.

In my test/develop environment I'm using:

Internet Explorer
Firefox
Netscape
Opera

And for developing php I'm using the ZEND  studio

And allthough generating correct outputs when using the suggested code for implementing the custom headers in the FAQ and forum like
(allthough I'm not using static)


   if(empty($custom_header)){
      include('/path/your_file.php');
      static $custom_header = ob_get_contents();
      ob_clean();
   }


I got two warnings from ZEND studio like:

Cannot modify header information - headers allready sent by (output started at bla bla bla bla .php:1106)

(This was at the test server at localhost so no headers from third parties or something involved)

The file and line it mentioned was not generating the fault but what solved the warnings was including:

ob_start(); just before the include statement.

Allthough I don't think a lot of people will use php debuggers and will probably never see such output I just want to share this little code.
Don't ask me: Can you do this .... or Give me that...or I need Quick help in PM's. I'm not Santaclaus so post your questions on the board so it will be in the benefit for everyone.

kegobeer

I think that's the correct way of doing the output buffering.  Thanks for the tip.
Do not send me a private message unless I ask for one.  Make your post public so everyone can benefit.

There are no stupid questions
But there are a LOT of inquisitive idiots