Quote:
|
Originally Posted by dennispopel
<?php
$test = "1";
echo "some text here..."; // After THIS there is no effect of the header() call
if($test == '1')
{
header("location: test2.php");
}
echo "...";
?>
|
i thought the exact same thing!....but when i tested it, it actually worked.
I think its because the server im on has output_buffering enabled
Enables/disables output buffering. Output buffering enables you to send header lines (including cookies) even after you have sent the body content, however, PHP's output layer will be slowed down a bit. In addition to enabling/disabling output buffering for all files by setting this directive to ON/OFF, you can also selectively enable/disable output buffering at run time using the PHP functions ob_start, ob_end_clean, ob_end_flush, and ob_implicit_flush.