|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #32815 Problem with header() function
Submitted: 2005-04-24 23:16 UTC Modified: 2005-04-24 23:48 UTC
Avg. Score:4.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: webmaster at ebinformatique dot com Assigned:
Status: Not a bug Package: HTTP related
PHP Version: 4.3.10 OS: Windows XP 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 this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: webmaster at ebinformatique dot com
New email:
PHP Version: OS:


 [2005-04-24 23:16 UTC] webmaster at ebinformatique dot com
I have a problem with the header() function, it happened all off a sudden:

Whenever there is a call to header() to redirect a page (i tried the echo method in another bug report and this is the output it gave):


Whenever i do a redirection it points to a blank page, no source visible whatsoever. I tried updating version from 4.3.10 to 4.3.11 but no go, still same problem. But it was working fine so i hightly doubt it could be the form of the URL itself to be the problem.

Cleared my browser cache too, nothing helped. Tried in IE, Firefox, both with empty caches, same problem, i get a white page.

Reproduce code:
Here is a chunk of code that called a redirection function:

if ($tmp_bool_login) {

and the redirect_user:

function redirect_user($tmp_str_destination) {
 header('Location: ' . $tmp_str_destination);
 header('Content-Location: ' . $tmp_str_destination);
 header('Request-URI: ' . $tmp_str_destination);

Expected result:
If the $tmp_bool_login was successful, it would redirect to $_POST['redirect'] so that the user gets send back to the page he was when he signed in. not a blank page.

Actual result:
When filling the form with a user and pass, it sends to login and it's a success, but it fails to redirect to the page. In fact any redirection whatsoever fails.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2005-04-24 23:36 UTC] webmaster at ebinformatique dot com
I discovered there was 2 linebreaks in a file included before the redirection.

But even with error_reporting(E_ALL) it did not send me warnings or anything to the browser saying there was already some output generated.
 [2005-04-24 23:48 UTC]
Turn display_errors ON.
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Tue Nov 30 13:03:49 2021 UTC