想在页面上做个计数器 代码如下
<script language="iavascript">//计数器
  function get_hits($indexyj1.php){
        $hits="";
        if (file_exists($indexyj1.php)){
         $fp=fopen($indexyj1.php,"r");
         $hits=chop(fread($fp,filesize($indexyj1.php)));
         fclose($fp);
    }
    if($hits=="")$hits=0
    else
    $hits=(int)$hits;
    $hits++;
    if ($fp=fopen($indexyj1.php,"w")){
      fwrite($fp,$hits);
    
    }
    return $hits;
    document.write("<font color=#9B4E00 style='FONT-SIZE: 9pt'>"+$hits+"</font>");
    
</script>
在一个表格的显示代码为
<td width="80"><div align="center"><span class="style2">欢迎您第</span> </div>
                <td width="91"><div align="center">
                    <script language="javascript">get_hits(indexyj1.php);</script>
                  </div>
                <td width="58"><div align="center" class="style2">位客人 </div>
但是运行的时候网页上有错误,
说indexyj1未定义,功能无法实现。
请大家帮忙~!
谢谢~!