Re: Bug #2968: white space in document before setcookie() is called ruins chance to setcookie

From: Date: Mon, 13 Dec 1999 19:45:51 +0000
Subject: Re: Bug #2968: white space in document before setcookie() is called ruins chance to setcookie
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-13623@lists.php.net to get a copy of this message
This /IS/ the way it is supposed to be. Please see: http://www.php.net/manual/function.setcookie.php3 In short, /ANY/ whitespace is considered "text to be sent". --Joey Smith Please forgive the long sig: *** Notice To Bulk Emailers: Attention! Pursuant to US Code, Title 47, Chapter 5, Subchapter II, 227, any & all unsolicited commercial e-mail sent to this address is subject to a download and archival fee in the amount of the $1500 US and copies will be forwarded to domain administrators. Emailing denotes acceptance of said terms! On 13 Dec 1999 sladd@mail.rit.edu wrote: > From: sladd@mail.rit.edu > Operating system: Linux 2.2.13 > PHP version: 3.0.12 > PHP Bug Type: Parser error > Bug description: white space in document before setcookie() is called ruins chance to > setcookie > > I don't think this is the way it is supposed to be. > > If there is white space before a setcookie() call, even if no text is sent, setcookie fails > because it was thinking that text has been sent. > > More exactly, if we have this (the dashes indicate begining of file) > > ---------------------------------------- > <?php include("include.inc"); ?> > > <?php setcookie("test", "test", time()+60); ?> > ----------------------------------------- > > will FAIL, even though inside my include.inc I have no text being printed out. The following > DOES work. > > -------------------------------------- > <?php include("include.inc"); ?> > <?php setcookie("test", "test", time()+60); ?> > ------------------------------------- > > Notice how there is no space after the include. The whitespace outside of the <?php ?> > tags seems to matter. This is not clearly defined in the documentation, and I believe it's a > bug. > > > -- > PHP Development Mailing List <http://www.php.net/> > To unsubscribe, e-mail: php-dev-unsubscribe@lists.php.net > For additional commands, e-mail: php-dev-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net > >

« previous php.dev (#13623) next »