ID: 19778
Comment by: Xuefer at 21cn dot com
Reported By: php at savignano dot de
Status: Open
Bug Type: Feature/Change Request
Operating System: any
PHP Version: 4.2.1
New Comment:
by the way
php document never said: "headers get sent as soon they are
encountered"
and it seems different for each sapi module
it's better for php to buffer all response headers until give it to
sapi
and use:
header_flush();
to flush headers, but keep header_sent() false, which meaning header is
not ended yet
header_flush is only used to "ping" client to see if connection lost,
before output any content.
u may say, i can buffer it in script using array, but this is not able
to manage php's internal headers
Previous Comments:
[2003-06-13 08:06:41] Xuefer at 21cn dot com
in php manual:
> The optional replace parameter indicates
> whether the header should replace a previous similar
> header,
> or add a second header of the same type.
> By default it will replace, but if you
> pass in FALSE as the second argument you can force
> multiple headers of the same type
so it can "replace" header, is should be able to "unset" header
header() is to "low level"
better to implement these functions:
header_set($name, $value [, response_code]) // replace or set new one
header_add($name, $value) // "append" new one
header_unset($name, [, $count]) // remove all, or N
these functions will work, until header_sent(), after which will get
warnning.
it's just like operating on an array/table (but allow dup key)
[2002-11-11 15:02:22] php at savignano dot de
If you can modify headers using the header() function, they
can't be sent already, can they?
At least with some types of headers, this works.
So I assume that headers are buffered at least until the document
output has begun.
[2002-11-10 18:41:54] [EMAIL PROTECTED]
Blind shot - this is impossible because headers get sent as soon I they
are encountered and thus you can override them by sending one more yet
cannot remove what you have already sent. I might be wrong, though.
If I'm not then lots close this one.
[2002-10-06 08:29:27] php at savignano dot de
Sometimes it would be very handy to be able to remove a http header
that has already been set (for example, by the session module). Even
though header() allows me to replace a header, there is no way to
completely remove it.
Proposal:
header("Pragma:") could be used to remove a Pragma header - i.e. a
header given with no parms would remove the header.
Better:
New function like remove_header()
--
Edit this bug report at http://bugs.php.net/?id=19778&edit=1