Re: PEAR

From: Date: Sat, 05 Jan 2002 04:08:01 +0000
Subject: Re: PEAR
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-79536@lists.php.net to get a copy of this message
anyway, if you would really like to do this you could use output buffering function to send headers from anywhere in your script, ofcourse delaying output. check the manual part LXXII. Output Control Functions .. bvr. On Fri, 4 Jan 2002 22:37:13 -0500, Brian Clark wrote: >* harry (postituk@yahoo.com) [Jan 04. 2002 10:44]: > >> Hi all > >Hi Harry > >> I have been trying to use PEAR and have come to a standstill. > >> The following: > >> <?php > >> require_once ("HTML/Page.php"); > > > >> /* PAGE SETUP */ >> $p = new HTML_Page(); >> $p->setCache("true"); >> echo "TEST 1"; > >Try commenting the above line out. > >> //$p->toHtml(); >> echo "TEST 2"; > >Try commenting the above line out also. > >> // $p->setTitle("Jobsite Page"); > >> $p->display(); > >because in the display() method, it's sending header()s: > > >function display() >{ > if(! $this->_cache) { > header("Expires: Tue, 1 Jan 1980 12:00:00 GMT"); > header("Last-Modified: " . gmdate("D, d M Y H:i:s") . "GMT"); > header("Cache-Control: no-cache"); > header("Pragma: no-cache"); > } > $strHtml = $this->toHtml(); > print $strHtml; >} // end func display > > >> Produces the following error: > >Which is why you are getting this error about header information: > >> TEST 1TEST 2 >> Warning: Cannot add header information - headers already sent by (output >> started at /var/www/html/website/jobix/php_test/test_form.php:4) in >> /usr/share/php/HTML/Page.php on line 136 > >-- >Brian Clark | Avoiding the general public since 1805! >Fingerprint: 07CE FA37 8DF6 A109 8119 076B B5A2 E5FB E4D0 C7C8 >A day without sunshine is like, night. > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net >For additional commands, e-mail: php-general-help@lists.php.net >To contact the list administrators, e-mail: php-list-admin@lists.php.net > >

« previous php.general (#79536) next »