php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #55436 Bad Examples on header()
Submitted: 2011-08-16 22:45 UTC Modified: 2011-08-17 11:07 UTC
From: scotepi at gmail dot com Assigned:
Status: Not a bug Package: Documentation problem
PHP Version: 5.3.6 OS: Linux
Private report: No CVE-ID: None
 [2011-08-16 22:45 UTC] scotepi at gmail dot com
Description:
------------
---
From manual page: http://www.php.net/function.header%23Parameters
---

The example for a 404 header assumes you are using http/1.0 it should be 
header($_SERVER["SERVER_PROTOCOL"]." 404 Not Found") also, for the 404 example and  
the location example should at lest show you how to use the http_response_code 
maybe in a example #3

Test script:
---------------
<?php

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


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-08-17 11:07 UTC] bjori@php.net
-Status: Open +Status: Bogus
 [2011-08-17 11:07 UTC] bjori@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

http_response_code is linked from the seealso, and SERVER_PROTOCOL is not 101% 
guaranteed to be available.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon May 20 19:01:33 2024 UTC