php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #52351 Cannot send http status code without set new header raw
Submitted: 2010-07-15 20:02 UTC Modified: 2010-07-15 20:08 UTC
From: giorgio dot liscio at email dot it Assigned:
Status: Not a bug Package: HTTP related
PHP Version: 5.3.2 OS: all? Windows xp x64
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: giorgio dot liscio at email dot it
New email:
PHP Version: OS:

 

 [2010-07-15 20:02 UTC] giorgio dot liscio at email dot it
Description:
------------
hi, if i want only to send an http status code in php with the function header()
i must specify something on the first parameter otherwise the header is not sent

i want only to set 404 status code.. but none of those works

header("", TRUE, 404);
header(NULL, TRUE, 404);

but i need to use

header("X-Totally-Useless: true", TRUE, 404);

is this a bug?

thank you



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-07-15 20:08 UTC] rasmus@php.net
-Status: Open +Status: Bogus
 [2010-07-15 20:08 UTC] rasmus@php.net
As documented at http://php.net/header, you would do it like this:

header("HTTP/1.0 404 Not Found");
 [2010-07-15 20:21 UTC] giorgio dot liscio at email dot it
hi rasmus it's an honor to talk with you :)

header($_SERVER['SERVER_PROTOCOL'] . " 404 Not Found");

you don't think that this is actually hard to manage?

in plus, it is implemented in user space when it is already implemented by php

i don't like this

to make writing these things to the user increases the risk of bugs / incompatibilities with clients
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 17:01:30 2024 UTC