Re: calling external php file before <html> tag

From: Ben (crescent_au_at_yahoo.com)
Date: 08/31/04


Date: 30 Aug 2004 20:01:17 -0700

dq5studios@gmail.com (duz) wrote in message news:<79a9a2c6.0408300653.3d1d4938@posting.google.com>...
> crescent_au@yahoo.com (Ben) wrote in message news:<d99e1341.0408291746.37a90909@posting.google.com>...
> <snip>
> >
> > I get the following warning:
> > Warning: Cannot modify header information - headers already sent by
> > (output started at D:\Apache Group\Apache2\htdocs\phpfunc.php:26) in
> > D:\Apache Group\Apache2\htdocs\phpfunc.php on line 8
> >
>
> Make the very first line of your main file ob_start() and after you're
> done with setting the cookie do a ob_end_flush(). The first command
> will cause PHP to buffer the output until the second command is
> executed. This also means you don't need to put your cookie function
> before the <html> but it is a good idea to execute it as soon as you
> can so you don't have to worry about buffering too much output.
>

thanx duz,
it's working now...
i did like this in my main file:
<?php
        ob_start();
        include 'phpfunc.php';
        counter();
        ob_end_flush()
?>
<html><body></body></html>

Ben



Relevant Pages