Home >Backend Development >PHP Tutorial >How to implicitly call php program_PHP tutorial
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:
4 11 12 |
<🎜>$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<🎜> <🎜>?> |