why does include always opens my included file
although it is defined as a variable
Example:
$file=include(/myfile/myfile.txt/);
shouldn't it only be opend by typing
echo $file;
?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit:
[snip]
why does include always opens my included file
although it is defined as a variable
Example:
$file=include(/myfile/myfile.txt/);
shouldn't it only be opend by typing
echo $file;
[/snip]
The include() opens the file to place it in the variable, in other words
include means READ INTO.
on?
Schura
- Original Message -
From: Jay Blanchard [EMAIL PROTECTED]
To: 'Harry.de' [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Thursday, August 15, 2002 6:25 PM
Subject: RE: [PHP] include opens source, but it shouldn't
[snip]
why does include always opens my included file
although
you assigned to it.
This is covered in the manual,
Jason
-Original Message-
From: Sascha Braun [mailto:[EMAIL PROTECTED]]
Sent: Thursday, August 15, 2002 10:31 AM
To: PHP Mailingliste; Jay Blanchard
Subject: Re: [PHP] include opens source, but it shouldn't
Can't you use a fopen('$file
[snip]
What is in the file? Do you have a print($file) or echo somewhere? Does the
included file have print() or echo() in it?
No, in the file is only html
[/snip]
There you go ... HTML will be parsed by the browser and displayed. So it is
doing exactly what it is supposed to do.
HTH!
Jay
[snip]
[snip]
What is in the file? Do you have a print($file) or echo somewhere? Does the
included file have print() or echo() in it?
No, in the file is only html
[/snip]
There you go ... HTML will be parsed by the browser and displayed. So it is
doing exactly what it is supposed to do.
[/snip]
[snip]
Are you wanting to place the file into the variable so that you can echo it
out later? That is an extra step that you do not need. Just place the
include() function where you want it to appear.
But what do if i want echo it out later - That's exactly what i want do
[/snip]
You mean more
;?
- Original Message -
From: Jay Blanchard [EMAIL PROTECTED]
To: 'Jay Blanchard' [EMAIL PROTECTED];
[EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Thursday, August 15, 2002 7:03 PM
Subject: RE: [PHP] include opens source, but it shouldn't
[snip]
[snip]
What is in the file? Do you have a print($file
[snip]
Only on demand.
I'd like to define the variable without showing the file
$var=include();
do something else
echo $var;
[/snip]
Since the included file outputs headers you cannot do what it is you wish to
do AFAIK. When I do includes, and having looked at other's code I can say
that I
From: Jay Blanchard [mailto:[EMAIL PROTECTED]]
Sent: Thursday, August 15, 2002 1:19 PM
To: [EMAIL PROTECTED]
Subject: RE: [PHP] include opens source, but it shouldn't
[snip]
Only on demand.
I'd like to define the variable without showing the file
$var=include();
do something
10 matches
Mail list logo