|  | Posted by ED on 05/18/06 19:47 
"Ian Rutgers" <irutgers@otima.ca> wrote in message news:Ve1bg.174482$WI1.146933@pd7tw2no...
 >
 > "ED" <ed@example.com> wrote in message
 > news:Qn0bg.14997$z%.13147@newsfe5-win.ntli.net...
 >>
 >> "Martin Jay" <martin@spam-free.org.uk> wrote in message
 >> news:gpN0+7GOpFbEFwEo@onenet.org.uk...
 >>> In message <cPOag.172827$WI1.101092@pd7tw2no>, Ian Rutgers
 >>> <irutgers@otima.ca> writes
 >>>>...still didn't do a redirecti ... even put the thank you page in the
 >>>>same
 >>>>folder as the other php file.  In that case I get an error message:
 >>>>"Warning: Cannot modify header information - header already sent by
 >>>>(output
 >>>>started at  ... url of file) in file name on line 332"
 >>>
 >>> Header must go before everything else in the document, even before
 >>> !DOCTYPE, <html>, and <head>.  Sending a space or new line would be
 >>> enough to prevent the redirect from working.
 >>>
 >>> And technically you should also add a reason for the redirect, such as
 >>>
 >>>         header ('HTTP/1.1 302 Moved Temporarily');
 >>>         header ('Location: ../thankyou.php');
 >>>
 >>> But in reality the first line can be left out.
 >>>
 >>> Do you really need to do a redirect, though?  HTML and PHP code can be
 >>> mixed.  Perhaps it would be easier to simply include the HTML after the
 >>> PHP code in the same file.
 >>> --
 >>> Martin Jay
 >>
 >>
 >> Also technically, the Location header should point to an absolute url,
 >> ie:
 >> header('Location: http://www.mydomain.com/thankyou.php');
 >>
 >> cheers,
 >> ED
 >>
 > Hi ED,
 >
 > I switched to an absolute URL with the same result....
 > Warning: Cannot modify header information - headers already sent by
 > (output started at
 > /home3/thetruth/thetruthsearch-www/explore/what_did_jesus_claim.php:7) in
 > /home3/thetruth/thetruthsearch-www/explore/what_did_jesus_claim.php on
 > line 322
 >
 >
 Basically the problem is that you have some output before the Location
 header is sent, could be HTML, whitespace,
 echo / print statements or something sent in an included file etc, but
 *something* is being sent to the browser (a typical culprit is a space or
 newline before an opening <?php tag). Block this output and the redirection
 should work fine.
 cheers,
 ED
  Navigation: [Reply to this message] |