See if is there some kind of echo before header()s, or HTML sent to
browser.
 You cannot do this
 <html>
 <head>
  Bla bla
 <?php header("Location : any_script.php\n\n");?>
 </head>
 <body>
 ....
</body>
 </html>
 Why? Because there is already content sent to the browser. If some code
uses
 header() place it before any output. As I said sometimes a simple echo()
 breaks all.

 Andrey Hristov
 IcyGEN Corporation
 http://www.icygen.com
 99%

> ----- Original Message -----
> From: "Casteele/ShadowLord" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Wednesday, August 22, 2001 6:52 PM
> Subject: [PHP] HTTP headers and include()
>
>
> > I've written a separate function library for a cluster of web pages, and
I
> > then include("slib.php") in each of the web pages, instead of copying
12k
> > of code to each page individually.  Some of the pages require (simple)
> > authentication or redirection headers, which some of the code in the
> > library is supposed to handle.
> >
> > Problem is, when I include the library, even though there's no other
> output
> > to be processed, it still generates the linefeed that triggers sending
all
> > the current headers, so if(!headers_sent) {...} fails.
> >
> > Is it possible to include php code without sending headers?  I've tried
> > exit() within the library, but that fails to work.  Instead, exit causes
> > generation of HTML code (a content type metatag) that is neither in the
> > main page nor the library.  I've also tried a simple return() (per the
> > documentation), but that generates a parse error.
> >
> > I'm using Apache 1.3.12, PHP 4.0.2 and Slackware Linux (Not sure which
> > kernel version).
> >
> > Thanks
> > Cas
> >
> > PS: Please CC replies to [EMAIL PROTECTED], since I'm not officially
> > subscribed to this list.  Thanks.
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
> >
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to