想在网页上做个计数器 代码如下 <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> 在表格的显示代码为 </div></td> <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> 预浏时,页面提示indexyj1未定义,功能无法实现~! 大家帮忙看看~! 谢谢~! |
计数器[php]
最新推荐文章于 2024-08-09 17:50:34 发布