I am writing a dynamic site engine sort of file. To be brief, I have part of the websites html stored in a db. In this html I have written to allow
[menu]
then I preg_replace that with the dynamic html for the menu.
Here is the code. The file it includes is the menu html with php variables.
/****************************************
| Getting Template Variables |
****************************************/
$stylevariable = @mysql_query("SELECT * FROM template WHERE site = '".$sitename."'");
$style = mysql_fetch_array($stylevariable);
// Template variables are now $style[nameindatabase]
$style['header'] = preg_replace("/\[date\]/", date('d M y, Hi T'), $style['header']);
$menu = include($htmlpath."/resources/menupre.php");
$style['header'] = preg_replace("/\[menu\]/", $menu, $style['header']);
Here is the problem. Since the $menu var that [menu] is replaced with is defined by including php with html it sends the headers.
How can I keep this html from being output until I call for it?
Herk
Reading through that, it sounds even to me like gibberish, but I don't know a better way to explain what I mean. If you understand please help.