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.
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?
GET /tracking/test.php HTTP/1.1
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-Encoding: gzip, deflate, compress;q=0.9
Accept-Charset: ISO-8859-1, utf-8;q=0.66, *;q=0.66
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
Keep-Alive: timeout=15, max=100
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php