萬盛學電腦網

 萬盛學電腦網 >> 網絡編程 >> php編程 >> 隱性調用php程序的方法

隱性調用php程序的方法

 本文實例講述了隱性調用php程序的方法。分享給大家供大家參考。具體如下:

 代碼如下: <mce:script language = "javascript" src = "count.php"></mce:script> 1 2 3 4 5 6 7 8 9 10 11 12 13 <?php $file_name = "count.txt"; $fp = fopen($file_name,"r"); //打開文件讀入當前計數 $count = fread($fp, filesize($file_name)); fclose($fp); $count++; //計數加1 $fp = fopen($file_name, "w"); //再次打開文件寫入更新後的計數 fwrite($fp, $count); fclose($fp); echo "document.write('".$count."')"; //輸出JavaScript代碼,返回計數 ?>
copyright © 萬盛學電腦網 all rights reserved