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
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
11 + 16 = ?
Subscribe to this entry?

 
 [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-2021 The PHP Group
All rights reserved.
Last updated: Tue Nov 30 13:03:49 2021 UTC