Re: Include question
| From: | Justin French | Date: | Wed, 12 Jun 2002 01:48:47 +0000 |
| Subject: | Re: Include question | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-101660@lists.php.net to get a copy of this message | ||
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 (tom@blazestudios.com) 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:tom@blazestudios.com]
>>> Sent: Tuesday, June 11, 2002 9:29 PM
>>> To: php-general@lists.php.net
>>> 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
>>>
>>>
>>
>>
>> .
>>
>>
>>
>
>