You are here: storing included file output in buffer? « PHP Language « IT news, forums, messages
storing included file output in buffer?

Posted by Schraalhans Keukenmeester on 07/25/05 16:36

I have a class webpage that allows me to build a page before outputting it.

It has member functions header(), footer(), body('literal html string'),
bodyhtmlfile ('filename to html file')

I would like to be able to include (the output) of php files as well.
Is it possible to have a separate php file produce some output (e.g.
some table filled with mysql db entries) which I can store in a webpage
instance ?

I tried this:
class webpage
{
[...]
function bodyphpfile ($filename)
{
$this->content .= include "$filename";
}
[...]
}

but as I expected include doesn't do it, as it only returns a bool.
If I treat the php file like a html file (parsed line by line) it simply
adds the php lines to the output, but of course it isn't parsed by the
PHP interpreter.


Help appreciated.
KR
Schraalhans

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация