<td colspan="3"><input name="IP" type="text" id="IP" value="{IP}">

解决方案 »

  1.   

    应该是
    <td colspan="3"><input name="IP" type="text" id="IP" value="{$IP}">
      

  2.   

    可是现在的错误是
    Call to a member function on a non-object in /var/www/html/test.php 
    好像跟本就没有建立实例...
      

  3.   

    $template=("/var/www/html/template_dir/template.html");改为
    $template->display("var/www/html/template_dir/template.html");并放在最后
      

  4.   

    老兄你连new smarttemplate都没有,就用?
      

  5.   

    晕死了,我的test.php和template.html文件分别是
    test.php
    -------------------------------------------------------------
    <?php 
        include ('class.smarttemplate.php');
        $template->display("var/www/html/template_dir/template.html");    $text  =  'Sample Text'; 
        $template->assign( 'IP', $text );     $template->output(); 
    ?>
    --------------------------------------------------------------------template文件是:
    --------------------------------------------------------------------
    <html><body><input name="IP" type="text" id="{$IP}"></body></html>
    --------------------------------------------------------------------
    浏览器输出是:
    Fatal error: Call to a member function on a non-object in /var/www/html/test3.php on line 3
    请大家看看是哪里出了问题阿??
      

  6.   

    <?php 
        include ('class.smarttemplate.php');    $text  =  'Sample Text'; 
        $template->assign( 'IP', $text );     $template->display("var/www/html/template_dir/template.html");
    ?>
      

  7.   


    <?php 
        include ('class.smarttemplate.php');    $text  =  'Sample Text';    $template=new Smarty();
        $template->assign( 'IP', $text );     $template->display("var/www/html/template_dir/template.html");
    ?>
      

  8.   

    噢,呵呵...晕死了...现在好了,不过只能显示一个Sample,后面的' Test'都不知道跑到哪去了???
      

  9.   

    开玩笑,类都没有定义,就能用?
    而且楼上的楼上的那个定义,居然用 $template=new Smarty();?这是smarttemplate啊!
      

  10.   

    晕了!当成Smarty了.
    <?php    require_once "class.smarttemplate.php";
        $template= new SmartTemplate("var/www/html/template_dir/template.html");
        $text  =  'Sample Text';
        $template->assign( 'IP', $text ); 
        $template->output();?><html><body><input name="IP" type="text" id="IP" value="{IP}"></body></html>