ID:               27587
 Updated by:       [EMAIL PROTECTED]
 Reported By:      webmaster at digitalanime dot nl
 Status:           Bogus
 Bug Type:         Output Control
 Operating System: Linux
 PHP Version:      4.3.4
 New Comment:

Perhaps the variables are just empty? Anyway, this works fine using
those variables unless they are not set, please use the
[EMAIL PROTECTED] mailinglist for support questions.


Previous Comments:
------------------------------------------------------------------------

[2004-03-13 13:01:23] webmaster at digitalanime dot nl

Yes, I already tried that several times... But without result.



header('Location: index.php');

Works.



header('Location: ' . $_SERVER['PHP_SELF']);

Doesn't work.



And so with this one:



header('Location: http://www.digitalanime.nl/index.php?p=beep

Works.



header('Location: http://www.digitalanime.nl' .
$_SERVER['REQUEST_URI']);

Doesn't work.

header('Location: http://www.digitalanime.nl/' .
$_SERVER['REQUEST_URI']);

Doesn't work.



In all examples with Doesn't work, I get the same result, a blank page.

------------------------------------------------------------------------

[2004-03-13 12:50:05] [EMAIL PROTECTED]

Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions. 

Thank you for your interest in PHP.

You're abusing the header function, "Location" must be a capital "L"
and you are required to specify the FULL URI:

http://server.example.com/filename.php

------------------------------------------------------------------------

[2004-03-13 12:46:21] webmaster at digitalanime dot nl

Description:
------------
Hello there..



I've been fighting with this code for about a day or two, but it just
doesn't seem to work..



If I use output buffering, post a form and want to do a header(), it
works.... Only it doesn't when I want to use $_SERVER['REQUEST_URI']..

Reproduce code:
---------------
<?php

ob_start(); // start the outputbuffer

if(!empty($_POST) && !isset($_SESSION['form'])) { // my POST is full,
but we can't find a session variable... Strange.. There's someone
fucking with my site

 header('location: ' . $_SERVER['REQUEST_URI']);

}

if(empty($_POST)) { // POST is empty... Let's show a form here:

 // do my form here + make a session for the form

}

else { // POST is NOT empty... Let's handle the data

 // handle my data here

}

if(!empty($_POST) && isset($_SESSION['form'])) { // my POST is full,
and the session exists.. Fine, let's unset() it. :)

 unset($_SESSION['form']); // unsetting the session..

}

ob_end_flush();

?>

Expected result:
----------------
Well, the first thing I wanted to see, is that the form shows up (yes,
it really does, so that's not wrong..)



After that, I'll fill it in and submit it..



I get my data and so.. But, if I refresh, the browser asks me if I want
to send the data again.... I click yes, and my code works, except for
the header().



If I put header('location: index.php'); in it, It works, but not with
$_SERVER['REQUEST_URI'].



EVERYTHING works, except for REQUEST_URI, QUERY_STRING and any of the
GET variables..

Actual result:
--------------
A whole blank page..



With about:blank in the title bar..



Al that, nothing more, nothing less.


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=27587&edit=1

Reply via email to