http://localhost/Untitled-19.php

来源:互联网 发布:js 获取毫秒数 编辑:程序博客网 时间:2024/06/02 21:02
欢迎光临本站,您是第32位访问者

<?php
if (file_exists("count.txt"))
{
  $ff=fopen("count.txt","r");
  $c=fgets($ff);
  $c++;
  fclose($ff);
}
else
{
$c=1;
}
$ff=fopen("count.txt","w");
fputs($ff,$c);
fclose($ff);
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>计数器</title>
</head>

<body>
<center>欢迎光临本站,您是第<?php echo $c;?>位访问者</center>
</body>
</html>