Re: fread strangeness (was: nested echo and includes, mixed html / PHP)
| From: | David Robley | Date: | Tue, 20 Feb 2001 01:03:26 +0000 |
| Subject: | Re: fread strangeness (was: nested echo and includes, mixed html / PHP) | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-40682@lists.php.net to get a copy of this message | ||
On Tue, 20 Feb 2001 11:37, Jaxon wrote:
> Same problem, found it's coming from somewhere else :(
> It looks as if fread or fopen is preventing PHP from from parsing ...
>
> index.php:
>
> <?
> $file="test.inc";
> $fd = fopen ($file, "r");
> $string = fread ($fd, filesize ($file));
> fclose ($fd);
> echo "$string";
> ?>
>
> test.inc:
>
> <html>
> <body>
> <? echo "this comes from inside of test.inc"; ?>
> </body>
> </html>
>
> index.html show a blank html page, with the contents of test.inc
> visible via view source...grr. how can I get it to actually parse the
> PHP?
>
> help!
> jaxon
>
eval() is possibly what you need.
--
David Robley | WEBMASTER & Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES | http://www.nisu.flinders.edu.au/
AusEinet | http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA