php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #18688 header() not replacing existing header.
Submitted: 2002-08-01 12:06 UTC Modified: 2002-08-02 07:43 UTC
From: t_o_m_ at yahoo dot com Assigned:
Status: Closed Package: IIS related
PHP Version: 4.2.2 OS: Windows 2000 Server SP2
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: t_o_m_ at yahoo dot com
New email:
PHP Version: OS:

 

 [2002-08-01 12:06 UTC] t_o_m_ at yahoo dot com
The second argument of the header() command is a boolean that indicates if a call to header() should replace a header of a similar name. Under IIS you get multiple headers regardless, see the examples below, note the number of Foo: headers in each:


Example Script (foo.php):
=========================

<?php
header('Foo: 123',true);
header('Foo: 456',true);
?>


Output from Apache/PHP:
=======================

tab@test% telnet localhost 80
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
GET /~tab/foo.php HTTP/1.0

HTTP/1.1 200 OK
Date: Thu, 01 Aug 2002 15:57:02 GMT
Server: Apache/1.3.26 (Unix) PHP/4.2.2 mod_ssl/2.8.9 OpenSSL/0.9.6a
X-Powered-By: PHP/4.2.2
Foo: 456
Connection: close
Content-Type: text/html


Output from IIS:
================
tab@test% telnet tab 80
Trying 100.100.30.164...
Connected to tab.bwlaw.co.uk.
Escape character is '^]'.
GET /foo.php HTTP/1.0

HTTP/1.1 200 OK
Server: Microsoft-IIS/5.0
Date: Thu, 01 Aug 2002 16:00:44 GMT
Content-type: text/html
X-Powered-By: PHP/4.2.2
Foo: 123
Foo: 456

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-08-02 07:43 UTC] sander@php.net
This should be fixed, please try a snapshot from snaps.php.net and reopen this report if that's not the case.
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Wed Oct 07 20:00:02 2026 UTC