php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #31239 http header function cannot set content-length
Submitted: 2004-12-22 10:04 UTC Modified: 2004-12-22 14:12 UTC
From: pnewman at wanadoo dot nl Assigned:
Status: Not a bug Package: Apache2 related
PHP Version: 4.3.10 OS: fedora core 2 (linux)
Private report: No CVE-ID: None
 [2004-12-22 10:04 UTC] pnewman at wanadoo dot nl
Description:
------------
Hi (again)

I recently submitted but as it is closed and I am now using 4.3.10 I will submit a different one.  This is the old one:
http://bugs.php.net/bug.php?id=31197

Regards,
Peter.

Reproduce code:
---------------
<?php
 ob_start();
 header("Content-Type: text/html");
?>
 <html>
 <body>
 <h1>sdf</h1>
 </body>
 </html>
<? 
 $oblen = ob_get_length();
 header('Content-Lengt: ' . $oblen);
 $oblen = ob_get_length();
 header('Content-Lengt2: ' . $oblen);
 $oblen = ob_get_length();
 header('Content-Length: ' . $oblen);
 ob_end_flush();
?>


Expected result:
----------------
$ lynx -head -source http://localhost/tmp.php
HTTP/1.1 200 OK
Date: Wed, 22 Dec 2004 08:59:31 GMT
Server: Apache/2.0.51 (Fedora)
X-Powered-By: PHP/4.3.10
Content-Lengt: 43
Content-Lengt2: 43
Content-Length: 43
Connection: close
Content-Type: text/html; charset=UTF-8
 
$ lynx -source -dump http://localhost/tmp.php
<html>
<body>
<h1>sdf</h1>
</body>
</html>


Actual result:
--------------
$ lynx -head -source http://localhost/tmp.php
HTTP/1.1 200 OK
Date: Wed, 22 Dec 2004 08:59:31 GMT
Server: Apache/2.0.51 (Fedora)
X-Powered-By: PHP/4.3.10
Content-Lengt: 43
Content-Lengt2: 43
Connection: close
Content-Type: text/html; charset=UTF-8
 
$ lynx -source -dump http://localhost/tmp.php
<html>
<body>
<h1>sdf</h1>
</body>
</html>


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-12-22 14:12 UTC] derick@php.net
Please do not submit the same bug more than once. An existing
bug report already describes this very problem. Even if you feel
that your issue is somewhat different, the resolution is likely
to be the same. 

Thank you for your interest in PHP.

Never submit bugs twice! Duplicate of bug #31197
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 18 02:02:52 2024 UTC