#23228 [Opn->Bgs]: output function

From: Date: Tue, 22 Apr 2003 19:18:21 +0000
Subject: #23228 [Opn->Bgs]: output function
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-38083@lists.php.net to get a copy of this message
ID: 23228 Updated by: pollita@php.net Reported By: prof_moriarty at veryfast dot biz -Status: Open +Status: Bogus Bug Type: Feature/Change Request Operating System: Win 98 PHP Version: 4.3.0 New Comment: headers_sent() will do what you want. I know you're asking for a function which tells you if NON-header infomation has been sent (as stated in your second paragraph), but the exact way in which headers are buffered needs to be understood. headers are never sent until content is forced out to the browser. Therefore headers_sent() will not return TRUE until real content has reached the browser. If output buffering is on, real content (such as: print "foo!\n"; ) can be in the buffer (but not sent to the browser) without having sent headers (and so headers_sent() will return FALSE). When that buffer is flushed to the browser however, the headers are flushed as well (making that function return TRUE). If output buffering is not on, individual headers can be sent, but headers_sent() will not yet return TRUE because header content is psuedo-buffered until content is sent. Again, once content is output the headers are flushed and headers_sent() will begin returning TRUE. Previous Comments: ------------------------------------------------------------------------ [2003-04-15 15:18:25] prof_moriarty at veryfast dot biz A feature request. I've been reading through the manual for 4.3.something, and i can't find a function to do this, so i figured i'd suggest it. Basically a function that will determine if any data has actually been sent to the browser, and return TRUE or FALSE depending on the result. This function would check to see if ANY data had been sent to the browser (cookies and headers excluded), including error messages! I realise there are the "output control functions", however in the case i have, they don't really help me. Partially because i'm not sure if errors are actually buffered or sent straight through ignoring them. Also there is the $php_errormsg variable, but that's only related to the 'track errors' configuration which defaults to off (meaning it's never going to be on on a host). Thanx Jonathan ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=23228&edit=1

« previous php.bugs (#38083) next »