Re: require() results in session and header-sent errors
| From: | Richard Lynch | Date: | Tue, 31 Jul 2001 07:03:24 +0000 |
| Subject: | Re: require() results in session and header-sent errors | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-60341@lists.php.net to get a copy of this message | ||
Betcha a dollar there's a newline after that last ?> in the first of the two
included files:
> <?
> define("INTRANET_DB","intranet");
> define("INTRANET_APPS_TABLE","apps");
> define("INTRANET_APPS_FOLDER","apps");
> define("INTRANET_FOLDER","/"); file://Server Root
> define("INTRANET_TEST_PASSWORD","test");
> ?>
^
/ \
/ \
Right about here.
Use "vi" and see if you can cursor down to the line below ?>
If you can, hit "dd" until you are forced up on to the ?> line, and then use
":wq" to "write" and "quit"
PS Neither require nor include is a function, so parantheses are silly
there:
require "whatever.inc";
Your current parens are *NOT*, repeat *NOT*, doing what you think -- They
are forcing PHP to "calculate" the whatever.inc bit "first", just as they
would if you had:
$foo = (2 + 3) * 4;
Since there ain't no calculation to "whatever.inc", they're just silly.
PPS emacs can have "add newline after unfinished last line" or somesuch
stupid flag turned ON, which will automagically screw up any include file
every time you edit it. That's why I'm suggesting "vi" above. YMMV.
--
WARNING richard@zend.com address is an endangered species -- Use
ceo@l-i-e.com
Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm