Topic: Problem with header

I started to edit the header to fit my site.

And in header.php i wanted to add:

// START SUBST - {include.login.php}
$tpl_main = str_replace('{include.login.php}', include('../include.login.php'), $tpl_main);
// END SUBST - {include.login.php}

But all html code in include.login.php was included before <html> ...

How can I fix it? Where should I put my code in header.php?

// ToTe

Re: Problem with header

Well, "include('../include.login.php')" will run the script, it won't return the output. What you have to do is to use a little output buffering:

// START SUBST - {include.login.php}


$tpl_temp = ob_get_contents();
$tpl_main = str_replace('{include.login.php}', $tpl_temp, $tpl_main);
// END SUBST - {include.login.php}

"Programming is like sex: one mistake and you have to support it for the rest of your life."