Re: [PHP] fread strangeness (was: nested echo and includes, mixed html / PHP)
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: > > > > > > > > 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 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] fread strangeness (was: nested echo and includes, mixed html /PHP)
Same problem, found it's coming from somewhere else :( It looks as if fread or fopen is preventing PHP from from parsing ... index.php: test.inc: 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 On 2/19/01 6:16 PM, "Jaxon" <[EMAIL PROTECTED]> wrote: > Hi PHPers! > > I'm doing a simple page build by: > - reading file.html into $string > - reading variables into $array > > and then: > echo (strtr($string, $array); > > The file.html held in $string contains some PHP > and file.inc also has some PHP > > I'm doing this to assemble the page via little 'modules'. > > This is not working, e.g. the PHP in $string is not getting parsed by PHP > before being output to the browser, although I DO see the PHP in the > resultant page source...any ideas? > > Any comments welcome! > > regards, > jaxon > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]