...

View Full Version : Help to improve template script



Nightfire
11-03-2002, 04:58 PM
I've been working too hard today and I can't figure out how to change the value inside the <!-- title --> to $title automatically.

I've tried

$template = eregi_replace("<!-- ".$value." -->", $value, $template)

but that's not doing anything. Here's what I'm using now


$title = "hello";
$bodytext = "test";

$filename = "theme.html";
$fp = fopen($filename,"r");
$template .= fread($fp,filesize($filename));
fclose($fp);
$template = eregi_replace("<!-- title -->",$title,$template);
$template = eregi_replace("<!-- bodytext -->",$bodytext,$template);

echo $template;


I just want to cut out doing the

$template = eregi_replace("<!-- bodytext -->",$bodytext,$template);

for every single tag in the template.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum