Include not evaluating php code

I’m having problems getting php to evaluate php code when I use include on files. It only outputs the html code and not the php code, as well as the php code appearing when I go on view source!

I’m using a template generator which parses files but only seems to generate the hmtl. So it includes Template.php but only outputs the html. Any help would be great, thanks.

class Page
var $page;

function Page($template = ‘Template.php’) {
if (file_exists($template))
$this->page = join("", file($template));
die(“Template file $template not found.”);

function parse($file) {
$buffer = ob_get_contents();
return $buffer;

function replace_tags($tags = array()) {
if (sizeof($tags) > 0)
foreach ($tags as $tag => $data) {
$data = (file_exists($data)) ? $this->parse($data) : $data;
$this->page = eregi_replace("{" . $tag . “}”, $data, //Replaces place holders with input data
die(“No tags designated for replacement.”);

function generateLayout() {
echo ($this->page);

Sponsor our Newsletter | Privacy Policy | Terms of Service