|
<script language = "Javascript" src = "count.php"></script>
count.php源碼:
復(fù)制代碼 代碼如下:
<?php
$file_name = "count.txt";
$fp = fopen($file_name,"r"); //打開文件讀入當(dāng)前計(jì)數(shù)
$count = fread($fp, filesize($file_name));
fclose($fp);
$count++; //計(jì)數(shù)加1
$fp = fopen($file_name, "w"); //再次打開文件寫入更新后的計(jì)數(shù)
fwrite($fp, $count);
fclose($fp);
echo "document.write('".$count."')"; //輸出JavaScript代碼,返回計(jì)數(shù)
?>
php技術(shù):隱性調(diào)用php程序的方法,轉(zhuǎn)載需保留來(lái)源!
鄭重聲明:本文版權(quán)歸原作者所有,轉(zhuǎn)載文章僅為傳播更多信息之目的,如作者信息標(biāo)記有誤,請(qǐng)第一時(shí)間聯(lián)系我們修改或刪除,多謝。