Bug #16842 Updated: header() function doesn`t work

From: Date: Tue, 25 Jun 2002 08:05:06 +0000
Subject: Bug #16842 Updated: header() function doesn`t work
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-12016@lists.php.net to get a copy of this message
 ID:               16842
 Updated by:       kubacki@uwth.uni-hannover.de
 Reported By:      sanya@mail.ru
 Status:           Open
 Bug Type:         HTTP related
 Operating System: Windows XP
 PHP Version:      4.2.0
 New Comment:

I've noriced the bug only occurs if you're using PHP as module. Running
it as CGI solves the problem in the mentioned versions.
Probably there's something about the module?


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

[2002-06-24 13:07:00] kubacki@uwth.uni-hannover.de

No, the solution doesn't work for me. I've tested it with 4.2.0, 4.2.1
and 4.3.0-dev and it doesn't work.

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

[2002-06-12 09:28:15] shiflett@php.net

So does this solution work for those experiencing this problem?

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

[2002-06-09 11:42:40] sabedard@jig.to

I think I have the answer to this one.   If you are using the
php4ts.dll from 4.2.1 with the old dlls from 4.1.2 (in the C:\php\dll
and c:\php\extensions) this header problem will occur.  However, if you
just replace these old dll's with the correct 4.2.1 versions all will
be well.  Specifically I think mismatching c:\winnt\system32\php4ts.dll
and c:\php\sapi\php4apache.dll is the real issue. Of course, the best
way to solve this it to uninstall 4.1.2, clean the directory and
install 4.2.1 :) 

Thanks, 
   Shawn

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

[2002-06-09 10:40:13] sabedard@jig.to

I am experiencing the same problem with 4.2.1 on Win2000.  The
following code works fine with 4.1.2 but does not redirect in 4.2.1.  

...

if (isset($HTTP_POST_VARS["submit_login"])) {

	$tbp = new Users();
	$tbp->retrieveDb( "where user_id = '" .$HTTP_POST_VARS["fuser_id"].
"'
and password='" .$HTTP_POST_VARS["fpassword"]. "'" );
	$uid = $tbp->getField("user_id");
	if (!$uid) { 
		$login_success = false;
	} else {
		$path = str_replace ("reg_login","reg_type",$PHP_SELF);
		$tbp->log("Directing to Location: http://" .$SERVER_NAME.
$path);
		header ("Location: http://" .$SERVER_NAME. $path); 
	}

}
.... 

Looking at my log the Location path is correct.  I have even tried
surrounding this code by ob_start() and ob_end_flush() with no luck.  
There is a reference in the header documnentation page indecating that
referencing all variable with a @ will fix this problem.  But that just
seems wrong.  Any workaround would be greatly appreciated.

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

[2002-06-08 04:47:49] mfischer@php.net

Reopen

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

The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
    http://bugs.php.net/16842

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



Thread (25 messages)

« previous php.bugs (#12016) next »