tt.htm要写成-----
document.write ("<b>xx</b>");
...
document.write ("<i>xx</i>");
-----

解决方案 »

  1.   

    iframe啊,,!!!!!!!!!!!!!!!!
    那样怎么行,,
      

  2.   

    <script language="JavaScript" src = "./ccmmn/php/tt.htm"></script>
    这种SRC只能引入javascript的文件
      

  3.   

    <?phprequire ("./include/config.inc.php");
    require "include/class_basic_record_file.php";
    require "include/classes.php";//参数说明:$titlelen-标题长度;$action-显示动作;$category-文章大类;$type-文章小类;
    //                    $author-是否显示作者;$date-是否显示日期;$read-是否阅读次数;
    //                    $count-显示数量//默认值处理
    if(empty($titlelen)) $titlelen = 20;
    if(empty($count)) $count = 10;$aSoft = new CSoft;
    $aSoft->open();if ($action == "hot") $posList = $aSoft->OrderByDownNum($category, $type);  //热门文章
    elseif($action == "comment") $posList = $aSoft->FilterByComment($category, $type, $count);  //最新推荐
    elseif($action == "new") $posList = $aSoft->FilterByClass($category, $type, "1", $count);  //最新文章
    elseif($action == "class") showallclass();if (empty($setid)) $setid = 0;for($i = 0; $i < min($count, count($posList)); $i++)
    {
      $id = $posList[$i + $setid];
      $aSoft->setAbsolutePosition($id);
      // 判断标题长度
      $len = strlen($aSoft->name);
      if ($len <= $titlelen) $name = $aSoft->name;
      else
      {
         $name = substr($aSoft->name, 0, $titlelen); 
         $parity= 0;
         for($j=0;$j<$titlelen;$j++)
         { 
           $temp_str=substr($name,$j,1); 
           if(Ord($temp_str)>127) $parity+=1; 
          } 
          if($parity%2==1) $name=substr($name,0,($titlelen-1))."..."; 
          else $name=substr($name,0,$titlelen)."..."; 
        }  // 取出分类名称
      $aClass = new CClass;
      $aClass->open();
      $aClass->find($aSoft->class_id);
      $type2 = $aClass->class_name;
      $sort1id = $aClass->class_category_id;
      $aClass->close();  $aCategory = new CCategory;
      $aCategory->open();
      $aCategory->find($sort1id);
      $type1 = $aCategory->category_name;  $datetmp = date($set[dateformat], $aSoft->updatetime);  // 显示
      echo "document.write(\"<img src='{$set[sysPath]}/{$set[tplRoot]}{$set[tplMode]}/images/rss.gif'><a href='{$set[sysPath]}/index.php?modules=list&categoryid={$aSoft->category_id}&classid=$aSoft->class_id'>[$type2]</a> <a href='{$set[sysPath]}/index.php?modules=show&id=$id' title='{$aSoft->name} - {$type1}|{$type2} {$datetmp} {$aSoft->viewnum}/{$aSoft->daydowntimes}' target=_blank>$name</a> ";
      if($date == "yes") echo "<font color = #c0c0c0>&nbsp;$datetmp</font>";
      if($author == "yes") echo "<font color = #c0c0c0>&nbsp;文:$aSoft->empower</font>";  
      if($read == "yes") echo "<font color = #c0c0c0>&nbsp;阅:</font><font color = red>$aSoft->daydowntimes/$aSoft->downnum</font>";
      echo "<br>\");\n";
    }
    $aSoft->close();function showallclass() 
    {
      global $set;
      $aCategory = new CCategory;
      $aClass = new CClass;
      $aCategory->open();
      $aClass->open();
      
      if(!$aCategory->moveFirst()) exit;
      
      for($i = 0; $i < $aCategory->getRecordCount(); $i ++)
      {     
          $id = $aCategory->getAbsolutePosition();
          echo "document.write(\"<img src=\'{$set[sysPath]}/{$set[tplRoot]}{$set[tplMode]}/images/quote.gif\'>&nbsp;&nbsp;<a href='{$set[sysPath]}/index.php?modules=list&categoryid=$id' title = $category_reserved><b>$aCategory->category_name</b></a>:\");";
      $posList = $aClass->FilterByCategory($id);
      for($j = 0; $j < count($posList); $j ++)
      {
         $aClass->setAbsolutePosition($posList[$j]);  
             echo "document.write(\"&uarr;<a href='{$set[sysPath]}/index.php?modules=list&categoryid=$id&classid={$posList[$j]}' title = $aClass->reserved>$aClass->class_name</a>\");";
      }
     print "document.write(\"<br>\");";
      $aCategory->moveNext();
      }
      $aCategory->close();
      $aClass->close();
      exit;
    }?>以上是一个PHP文件,显示库中的内容,看上去是输出javascript,但不知为什么就是没有显示,而且单独运行这个PHP文件时也没有内容显示。库中我已添加了内容