關於fasttemplate的有關問題
來源:互聯網
上載者:User
關於fasttemplate的問題
今天我寫了一段PHP的fasttemplate代碼如下
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試試了嗎?你試過了?