php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #10865 function other than header() to switch to a new page?
Submitted: 2001-05-14 20:33 UTC Modified: 2001-05-15 02:19 UTC
From: logos at kith dot org Assigned:
Status: Closed Package: Feature/Change Request
PHP Version: 4.0.5 OS: MacOS X
Private report: No CVE-ID: None
 [2001-05-14 20:33 UTC] logos at kith dot org
I can understand why header() has to appear before any text or HTML, but it's not always feasible (especially when using include/require).  So I'd like to have a means other than header() to switch to a new page using PHP.  header() seems like a particularly low-level way to do this anyway; I'd like to have a high-level function that does the same thing without explicitly messing with headers.  If there already is such a function, then this becomes a documentation enhancement request: could you add a note to the header() documentation pointing people to the other function?

I should mention, btw, that I'm new to PHP, but liking it quite a bit so far.  Thanks for providing such a great language, and such extensive documentation for it!

--jed

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-05-15 02:18 UTC] derick@php.net
Having a new highlevel function won't solve the problem that you need to use it before any output.
That's because there need to be set a header (hence the name of the function) to the outputstream. That header must be send before any data.

You can however use the outputbuffering functions of PHP to use header in the middle of a page,
see the functions at www.php.net/ob_start, ob_get_contents etc.

I'm closing this report as this function would not add new
functionality to PHP.

Derick
 [2001-05-15 02:19 UTC] derick@php.net
status: closed
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed May 01 21:01:29 2024 UTC