呵呵,什么原因不好解说
1:确认你test.htm存在

解决方案 »

  1.   

    嗯,,看看你的模板路径有没有设置错误
    $tpl->template_dir=__TEMPLATES_PATH;,或确定你的TEST.HTM是否存在
      

  2.   

    我的测试代码:main.php
    <?php
    //include "comm/smarty.class.php";
    require ('./comm/Smarty.class.php');
    define ('_SITE_ROOT','E:/smarty');
    $tp1=new smarty();
    $tp1->template_dir=_SITE_ROOT."./templates/";
    $tp1->templates_c=_SITE_ROOT."./templates_c/";
    $tp1->config_dir=_SITE_ROOT."./configs/";
    $tp1->cache_dir=_SITE_ROOT."./cache/";
    $tp1->left_delimiter="{/";
    $tp1->right_delimiter="/}";
    ?>
    test.htm
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <HTML>
    <HEAD>
    <TITLE> New Document </TITLE>
    <META NAME="Generator" CONTENT="EditPlus">
    <META NAME="Author" CONTENT="">
    <META NAME="Keywords" CONTENT="">
    <META NAME="Description" CONTENT="">
    </HEAD>
    <BODY>
    <{$title}>
    <br>
    <{$content}>;
    </BODY>
    </HTML>
    test.php
    <?php
    include "main.php";
    $tp1->assign("title","测试用的网页");
    $tp1->assign("content","测试用的网页内容");
    $tp1->display("test.htm");
    ?>
    各位大哥看看呀!