Check that you actually have <? ?> wrapped around the PHP code in somefile.php that you include.
Justin French on 12/06/02 11:36 AM, Tom Ray ([EMAIL PROTECTED]) wrote: > Yes, but according to http://www.php.net/manual/en/function.include.php > I should be able to delcare the include and then pull the information > out normally. So by what the manual says I can do this > > somefile.php > <? > $apple = 'green'; > $pear = 'yellow'; > ?> > > callfile.php > <? > include 'somefile.php'; > echo "Apples are $apple and Pears are $pear"; \\ which would return the > line with green and yellow in the correct spots. > ?> > > But when I just do > > <? > include 'somefile.php'; > ?> > > It prints: > $apple = 'green'; $pear = 'yellow': > > > Why is that? > > > John Holmes wrote: > >> Umm...that's what it's supposed to do...it's "including" it... >> >> ---John Holmes... >> >> >> >>> -----Original Message----- >>> From: Tom Ray [mailto:[EMAIL PROTECTED]] >>> Sent: Tuesday, June 11, 2002 9:29 PM >>> To: [EMAIL PROTECTED] >>> Subject: [PHP] Include question >>> >>> I'm trying to use the include function in some PHP scripts, but when I >>> >>> >> do >> >> >>> include 'config.inc'; or include 'config.php; >>> >>> It returns all the information in the file when I look at my test php >>> file (which calls the include) Anyone know why this is? >>> >>> >>> -- >>> PHP General Mailing List (http://www.php.net/) >>> To unsubscribe, visit: http://www.php.net/unsub.php >>> >>> >> >> >> . >> >> >> > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

