Hello,
I am experiencing a little trouble using the class FastTemplate.
I've worked up a few php pages using this class for printing out the html. I've got a local server at home: Apache + PHP + MySQL.
The program works fine at home. But when I upload it to my Internet server, it works only every 4 / 5 times. The server gives out the following error message:
<i>
Warning: Invalid content of {} in your script on line 199
Warning: Invalid content of {} in your script on line 199
Warning: Invalid content of {} in your script on line 199
Warning: Invalid content of {} in your script on line 199
Warning: Invalid content of {} in your script on line 199
Warning: Invalid content of {} in your script on line 199
Warning: Invalid content of {} in your script on line 199
Warning: Invalid content of {} in your script on line 213
Warning: Invalid content of {} in your script on line 199
Warning: Invalid content of {} in your script on line 199
Warning: Invalid content of {} in your script on line 199
Warning: Invalid content of {} in your script on line 199
Warning: Invalid content of {} in your script on line 199
Warning: Invalid content of {} in your script on line 199
Warning: Invalid content of {} in your script on line 199
Warning: Invalid content of {} in your script on line 199
Warning: Invalid content of {} in your script on line 213
ERROR: Nothing parsed, nothing printed
</i>
and I need to reload the page a few times before it works.
The problem seems to appear when I parse and assign the templates. I have tried to slow the program down using php (i thought the server was slow and that it didn't have enough time to assign before parsing) but that didn't help.
Here is the code:
<i>
include ("class.FastTemplate.php3");
include ("db.php3");
$tpl = 0;
$tpl= new FastTemplate("./view_templates");
$tpl->define(array(
skeleton => "page_skeleton.tpl",
comment => "comment.tpl")
);
$tpl->assign("PAGETITLE", "forum");
$tpl->assign("PAGESTYLE", "style");
$db = connect_db();
$query = "select id, father_id, subject, email, body, posttime from comment where id=$id;";
$result = mysql_query ($query, $db);
$row = 0;
$data = mysql_fetch_object ($result);
$tpl->assign("SUBJECT", $data->subject);
$tpl->assign("TIMESTAMP", $data->posttime);
$tpl->assign("EMAIL", $data->email);
$tpl->assign("BODY", $data->body);
$tpl->assign("REPLY", "new.php3?father=$data->id");
$tpl->parse("PAGECONTENT", "comment");
$tpl->parse("MAIN", "skeleton");
$tpl->FastPrint();
exit;
</i>
Any idea?
Thanks
Thierry