Re: Re: header & headers_sent BUG

From: Date: Tue, 22 Jul 2003 06:45:06 +0000
Subject: Re: Re: header & headers_sent BUG
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-156428@lists.php.net to get a copy of this message
according to the php doc, online the headers are not affected by the Output Buffer, so any functions that manipulate the OB should have no effect. flush I do not beleive will fix this issue. (* I have tested it and it did not *) Still need a good way to accomplish this. Thanks, James Ivo Fokkema wrote:
You might want to check whether or not your header output is getting buffered. My suggestion is a flush() after the fist call. I'm not an expert on this, it's just an idea. HTH -- Ivo Fokkema PHP & MySQL programmer Leiden University Medical Centre Netherlands "James M. Luedke" <james@dod.net> wrote in message news:3F1CD481.1060802@dod.net...
Hello all: I am having a hard time with a small piece of code. I was wondering if someone may be able to explain why the following code will not work...
I
have been scratching my head for a few hours now and I am stumped. <?php header("Location: http://someplace.com"); if( ! headers_sent()) header("Location: http://somplaceelse.com"); ?> So I would expect this piece of code to direct me to somplace.com. However it does not, and I always end up at somplaceelse.com. I have done a tcpdump to assist with debugging here is the output below. From the look of it the first header is getting ignored all toghether. Is there some way to force changes I made to the headers, that will make headers_sent return TRUE? Thanks, -James --- GET /tracking/test.php HTTP/1.1 Host: dev.www.someplace.com User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.0) Gecko/20020623 Debian/1.0.0-0.woody.1 Accept:
text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q= 0.8,video/x-mng,image/png,image/jpeg,image/gif;q=0.2,text/css,*/*;q=0.1
Accept-Encoding: gzip, deflate, compress;q=0.9 Accept-Charset: ISO-8859-1, utf-8;q=0.66, *;q=0.66 Keep-Alive: 300 Connection: keep-alive Cookie: toolkitAccess=1 HTTP/1.1 302 Found Date: Wed, 23 Jul 2003 10:04:55 GMT Server: Apache/1.3.27 (Unix) mod_ssl/2.8.14 OpenSSL/0.9.6d PHP/4.3.1 mod_perl/1.27 X-Powered-By: PHP/4.3.1 Location: http://someplaceelse.com Keep-Alive: timeout=15, max=100 Connection: Keep-Alive Transfer-Encoding: chunked Content-Type: text/html ---


« previous php.general (#156428) next »