日期:2014-05-17  浏览次数:20498 次

关于fasttemplate的问题
今天我写了一段PHP的fasttemplate代码如下
<?php
  include   ( "class.FastTemplate.php3 ");

  $template   =   new   FastTemplate( ". ");

  $template-> define(array(main   =>   "main.tpl ",   newstable   =>   "newstable.tpl ",   newsrow   =>   "newsrow.tpl "));

  $listf   =   fopen(   "articlelist.txt ",   "r "   );

  list($title,   $category,   $date,   $fname)   =   fgetcsv($listf,   4096,   ": ");
  while(   !feof($listf)   )
  {
$template-> assign(STITLE,   $title);
$template-> assign(SCATEGORY,   $category);
$template-> assign(SDATE,   $date);
$template-> assign(SFNAME,   $fname);

$template-> parse(NEWSROWS,   ".newsrow ");
list($title,$category,$date,$fname)   =   fgetcsv($listf,   4096,   ": ");
  }
  $template-> parse(BODY,   newstable);
  $template-> parse(OUTPUT,   main);
  $template-> FastPrint(OUTPUT);
?>

但网页输出几乎是文件class.FastTemplate.php3中的内容,百思不得其解,请各位高手帮忙。先谢了!!

------解决方案--------------------
class.FastTemplate.php3 ?!

php文件一般是以php扩展名结束的,如果你没有在服务器特别设置php3也是的话。
你把文件的扩展名改php试试
------解决方案--------------------
不是让你把php3改成php试试了吗?你试过了?