im using fast template and the below added code to allow php code to run, only problem is after inserting the below code the result is two mirrors of my site (one below the other on a webpage), the first has all the php working and the second has everything but the php working. I know Ive probably forgotten to pull out some code when dropping the below in, but this is beyond my php understanding any guru's out there see what's wrong and what i should adjust. thanks for any help😕
{
if(empty($template))
{
$template = $this->LAST;
}
if( (!(isset($this->$template))) ||
(empty($this->$template)) )
{
$this->error("Nothing parsed, nothing printed",0);
return;
}
else
{
// ---- start changes
// generate a temporary file in the
// system tmp directory
$filename = tempnam("/tmp", "tmphtml");
if ($file = fopen($filename,"w"))
{
// dump the parsed template
fputs($file, $this->$template);
fclose($file);
// force the template to
// be parsed
include($filename);
// delete the temporary file
unlink($filename);
} else {
// panic - we probably don't
// have read and write
// permissions
$this->error("Unable to open temporary file for writing",0);
}
// ---- end changes
}
return;
}
im following mathew kendalls article "a template framework for static sites"
link to article