RE: [PHP] Include question
| From: | Peter | Date: | Wed, 12 Jun 2002 01:58:11 +0000 |
| Subject: | RE: [PHP] Include question | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-101661@lists.php.net to get a copy of this message | ||
Tom,
just did ur test on win2k php 4.2.1 with apache and when i just did ..
<?
include 'somefile.php';
?>
i get a blank screen as I should
the only way you should be getting anything is by calling the values...
-----Original Message-----
From: Tom Ray [mailto:tom@blazestudios.com]
Sent: Wednesday, 12 June 2002 11:36 AM
To: holmes072000@charter.net
Cc: php-general@lists.php.net
Subject: Re: [PHP] Include question
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
>>
>>
>
>
>.
>
>
>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php