How to implicitly call PHP programs
This article describes the method of implicitly calling PHP programs. Share it with everyone for your reference. The details are as follows:
The code is as follows:
1
2
3
4
5
6
7
8
9
10
11
12
13
|
$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代码,返回计数
?>
|
1
2
3
4
5
6
7
8
9
10
11
1213
|
<🎜>$file_name = "count.txt";<🎜>
<🎜>$fp = fopen($file_name,"r"); //Open the file and read the current count<🎜>
<🎜>$count = fread($fp, filesize($file_name));<🎜>
<🎜>fclose($fp);<🎜>
<🎜>$count ; //Count plus 1<🎜>
<🎜>$fp = fopen($file_name, "w");<🎜>
<🎜>//Open the file again to write the updated count<🎜>
<🎜>fwrite($fp, $count);<🎜>
<🎜>fclose($fp);<🎜>
<🎜>echo "document.write('".$count."')";<🎜>
<🎜>//Output JavaScript code and return count<🎜>
<🎜>?>
|
http://www.bkjia.com/PHPjc/1016472.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/1016472.htmlTechArticleHow to implicitly call PHP programs. This article describes the method of implicitly calling PHP programs. Share it with everyone for your reference. The details are as follows: The code is as follows: mce:script language = javascript...