|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2003-01-14 11:20 UTC] pthiebaud at labeltechnologies dot com
We have a PHP 4.3 installation on Windows 2000 Server & Workstation. On both systems, the following code produce a PHP crash.
<?PHP
header('Content-type: text/html');
header('Location: '.$url);
?>
If we remove the "header('Content-type: text/html');" line, the code work fine, but we need to be able to force the Content type header for our application to work.
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 16:00:02 2025 UTC |
We did try to remove the "header('Content-type: text/html')" portion of the code. We then have problems with the "print_r" or the "echo" functions that will not work correctly. We receive only part of the page, PHP seems to forget to process some lines of code. If we put back the header line, then the code works perfectly.No, the output is on the result page. Ex: page 1 redirect to page 2 and page 2 echos out "Hello World". In the case we put the "header('Content-type: text/html');" line we do see "Hello world", if we delete that line we don't se "Hello world" (not as simple as this, but you got the idea). By the way we also do an ob_flush to make sure everything is treated, but it doesn't change a thing.Windows 2k Pro, SP3 PHP 4.3.1, running as CGI IIS 5 I am experiencing a similar problem. If I hard-code the redirect page, then it works fine: <?php header("Location: goto.php"); exit; ?> But if I try to use a variable, INETINFO.EXE crashes (yes, it redirects to itself, but there are different execution paths): <?php ... header("Location: " . $_SERVER["SCRIPT_NAME"]); exit; ?> I have a reproducible case. Do you want the files?