1、在根目录新增counter.dat文件 2、在底部增加以下代码 ?php @session_start(); $counter = intval(file_get_contents("counter.dat")); if(!$_SESSION['#']) { $_SESSION['#'] = true; $counter++; $fp = fopen("counter.dat","w"); fwrite($fp, $counter); fclose($fp); } ?您是到访的第?php echo " […]
1、在根目录新增counter.dat文件
2、在底部增加以下代码
<?php @session_start(); $counter = intval(file_get_contents("counter.dat"));
if(!$_SESSION['#']) { $_SESSION['#'] = true; $counter++; $fp = fopen("counter.dat","w"); fwrite($fp, $counter); fclose($fp); } ?>
您是到访的第<?php echo "$counter";?>位用户