php.net |  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
Votes:1
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
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: webmaster at ebinformatique dot com
New email:
PHP Version: OS:

 

 [2005-04-24 23:16 UTC] webmaster at ebinformatique dot com
Description:
------------
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):

Location: http://192.168.1.100:99/members/logged_out.php

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) {
 Global_Functions::redirect_user($_POST['redirect']);
}

and the redirect_user:

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


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.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

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] tony2001@php.net
Turn display_errors ON.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Mar 19 06:01:30 2024 UTC