I wanted the script to redirect to different locations based on what
conditions were being met.  My problem turned out that I had an include
statement including an html file prior to the header function on line 17.
If I understand this correctly, the include statement was providing 'output'
and then it was trying to output again later in the header() function.  By
moving my include statement outside the <?php .....?> in the intial section
of code, it wasn't providing the output until after my header() function had
completed and there wasn't an issue anymore.

Thanks for your help.


"Erik Price" <[EMAIL PROTECTED]> wrote in message
> On Tuesday, June 25, 2002, at 06:07  PM, Brad Melendy wrote:
> > Well, I have traced this down to line 4 in the following code
> > 'include("header.html");' which just includes my navigation bar.  If I
> > comment it out, everything works great, if I leave it in, I get the
> > error
> > Headers Already Sent.  The file it purely html.  What could be the
> > problem??
> > Thanks in advance!
> You want this script to redirect twice?  Or do you just want it to
> redirect the first time, but have the second header() function be called
> if the first one doesn't?  Then you should call exit() after the first
> header() function to keep the rest of the script from executing.
> This is also generally a good practice after a header('Location: ') call
> because the user-agent doesn't HAVE to respect the header and redirect,
> so it protects your stuff.  Always feature an exit() with a header-based
> redirect.
> Erik
> ----
> Erik Price
> Web Developer Temp
> Media Lab, H.H. Brown

PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to