Re: [PHP-DEV] Bug #322: Header function works not correctly if include file contains trailing lines From: Zeev Suraski (bourbon <email protected>)
Date: 04/28/98

It's not a bug. Newlines outside the PHP code block will be sent as-is to
the browser as HTML, first triggering the HTTP header. After the HTTP
header is sent, you can't use the header() function anymore.

Zeev

On 28 Apr 1998 andreas.schmitter <email protected> wrote:

> From: andreas.schmitter <email protected>
> Operating system: AIX
> PHP version: 3.0 Release Candidate 4
> PHP Bug Type: Other
> Bug description:
> Description:
> If an include file contains a trailing line the
> function header("Location: xyz.html") does not redirect
> to the page xyz.htm
> --------------------------------------------------------
> test.php3
> <?
> include("./globals.inc");
> $str=" xxx ";
> $x=remove_spaces($x);
> header("Location: xyz.html");
> ?>
> --------------------------------------------------------
> globals.inc:
> <?
> function remove_spaces($str) {
> $str=ereg_replace("^ *","_",$str);
> $str=ereg_replace(" +$","_",$str);
> return $str;
> }
> ?>
>
> ------------------------------------------------------
> ./configure --with-apache=/u/users/zue/src/apache_1.2.6_php3 --with-oracle=/home
> /oracle/product/7.3.2.2 --with-config-file-path=/u/users/zue/www/httpd_8083/etc
> --enable-debug=no
> -------------------------------------------------------
> Additional Oracle Support (sql-based interface)
>

-- 
-----------------------------------------------------
Zeev Suraski <zeev <email protected>>
For a PGP public key, finger bourbon <email protected>