RE: PHP Header issue

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 2009-09-18 at 13:12 -0400, Ernie Kemp wrote:
> Thanks for your reply Andrew.
> I think you can add the "Header" in your body.
> 
> The code working on my local system.
> 
> Thanks,
> .../Ernie
> 
> -----Original Message-----
> From: Andrew Ballard [mailto:aballard@xxxxxxxxx] 
> Sent: September-18-09 12:44 PM
> To: Ernie Kemp
> Cc: php-general@xxxxxxxxxxxxx
> Subject: Re:  PHP Header issue
> 
> On Fri, Sep 18, 2009 at 12:39 PM, Ernie Kemp <ernie.kemp@xxxxxxxxxxxx> wrote:
> >
> > <html>
> >
> > <head>
> >
> > <title>Contact Us</title>
> >
> > </head>
> >
> > <body>
> >
> > <?php header("Location: advertise2.php"); ?>
> >
> > </body>
> >
> > </html>
> >
> > The above is just snippet of the code but even this simple example throws the Header Warning / Error.
> >
> >
> >
> > Warning: Cannot modify header information - headers already sent by (output started at /home/content/g/t/a /html/yourestate/advertise.php:6) in/home/content/g/t/a /html/yourestate/advertise.php on line 6
> >
> >
> >
> > The anwser may be simple but I have looked at blanks or spaces around the <?php ?> with no success.
> >
> > Ready need your help.
> >
> >
> >
> > Thanks,
> >
> > Ernie Kemp
> >
> > Phone: 416 577 5565
> >
> > Email:   ekemp@xxxxxxxxxxxxxxxx
> 
> It's all that HTML above and before <?php header("Location: advertise2.php"); ?>
> 
> You can't send ANY content to the client before sending headers.
> 
> Andrew
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
> 

You really can't add the header() where you have it. It must come before
*any* output sent to the browser. This includes any single character,
either if it's part of a tag, a word or even a single space or line
break.

Thanks,
Ash
http://www.ashleysheridan.co.uk




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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux