MyBB Community Forums

Full Version: php in templates?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
which template?
DennisTT Wrote:try:
ob_start();
include('yourfile.php');
$myfile_output = ob_get_clean();

And use $myfile_output in the template.
You would need to use:
ob_end_clean();
After that.
i still have that error you know Sad
dcgamers Wrote:which template?
The template you were editing which caused the problem.

CraKteR: The extra ob_end_clean isn't necessary, since ob_get_clean already deletes the current output buffer when run.
Yes, but it does not turn off the buffer.
Quote:ob_get_clean

(PHP 4 >= 4.3.0, PHP 5)
ob_get_clean -- Get current buffer contents and delete current output buffer
Description
string ob_get_clean ( void )

This will return the contents of the output buffer and end output buffering. If output buffering isn't active then FALSE is returned. ob_get_clean() essentially executes both ob_get_contents() and ob_end_clean().
oh sorry I read wrong. I'm so used to using ob_get_contents, sorry again.
Pages: 1 2