生成0000001000006.htm文件就可以了啊。

解决方案 »

  1.   

    可是用什么来取得 <option></option>
    之间的内容呢?
    应该不能这样。
    如果用DHTML
    应该就可以吧。
    但是写法都不一样啦。
      

  2.   

    你的模板是怎样写的?你可能是这样写的
    <td><a href='{url}?id={id}&sheng={text}'>{text}</a></td>
    处理时
    $ar = array(url => "next.php", id => $id, text => $text);
    $tpl->setvar($ar);如果你写作
    <td><a href='{url}'>{text}</a></td>
    处理时
    动态页面
    $ar = array(url => "next.php?id=$id&sheng=$text", text => $text);
    $tpl->setvar($ar);
    静态页面
    $ar = array(url => "$id.htm", text => $text);
    $tpl->setvar($ar);这样就可以了
      

  3.   

    <?php
    include_once("../config/config.php");
    include_once("../config/template.inc");
    include_once("../config/var.php");
    $temp = new template();
    $temp -> set_file("file","index.htm");
    $sql = "select * from zone where len(zone_code)>7 and len(zone_code)<=12";
    $result = new DB_Sql();
    $result -> connect();
    $result -> query($sql);
    $num = $result -> nf();
    for($i=0;$i<$num;$i++)
    {
    $result -> next_record();
    if($i%3==0)
    {
    $area.="<tr>";
    }
    $area.="<td width='6%'><img src='images/ic03.gif' width='30' height='29'></td>
              <td width='27%'><a href='next.php?id=".$result -> f("zone_code")."&sheng=".$result -> f("zone_name")."'>".$result -> f("zone_name")."</a></td>";
    if(($i+1)%3==0)
    {
    $area.="</tr>";
    }
    }
    $temp -> set_var("area",$area);
    $temp -> parse("out","file");
    $temp->savetofile("index.html", "out");
    $temp->renew();
      header("Location:index.html");
    ?>
    这是我的摸板
      

  4.   

    这是生成模板的函数,唠叨老大帮帮忙
      /****************************************
       * 函数名:savetofile($dir, $varName)
       *
       * 参  数:$dir:保存到的目录
       *         $varName:保存的文件名
       * 作  者:ccterran
       */
       function savetofile($dir, $varname)
       {
         $data = $this->finish($this->get_var($varname));
         $fp = fopen($dir, "w+");
         fwrite($fp, $data);
       }   /*************************************
        * 函数名:renew()
        *
        * 作  者:ccterran
        */
        function renew()
        {
          $this->varkeys = array();
          $this->varvals = array();
          $this->file = array();
        }
      

  5.   

    你那是在使用模板吗?不仅<td><a>标记甚至<tr>标记都出现在程序里,那还不如不用模板呢!按你的程序就直接修改循环中对$area赋值的语句吧
      

  6.   

    <?php
    include_once("../config/config.php");
    include_once("../config/template.inc");
    include_once("../config/var.php");
    $temp = new template();
    $temp -> set_file("file","index.htm");
    $sql = "select * from zone where len(zone_code)>7 and len(zone_code)<=12";
    $result = new DB_Sql();
    $result -> connect();
    $result -> query($sql);
    $num = $result -> nf();
    for($i=0;$i<$num;$i++)
    {
    $result -> next_record();
    //这里没有必要这么写,在模板添加一个变量,当$i==3时用"<br/>"替换这个变量
    if($i%3==0)
    {
    $area.="<tr>";
    }
    $area.="<td width='6%'><img src='images/ic03.gif' width='30' height='29'></td>
              <td width='27%'>
      //这里改了
      <a href='".$result -> f("zone_code")."htm'>".$result -> f("zone_name")."</a></td>";
    if(($i+1)%3==0)
    {
    $area.="</tr>";
    }
    }
    $temp -> set_var("area",$area);
    $temp -> parse("out","file");
    $temp->savetofile("index.html", "out");
    $temp->renew();
      header("Location:index.html");
    ?>
      

  7.   

    当$i==3时用"<br/>"替换这个变量
    写错了
    当$i==3时用"<tr/><tr>"替换这个变量