if(!file_exists("/tmp/count.txt"))
解决方案 »
- 使用onsubmit事件触发ajax时返回值怎么返回
- 各位大侠帮看个错误:SAFE MODE Restriction in effect
- 会用mail()函数的来帮帮忙
- .htaccess的问题
- 如何把等录PHP网站后用户的session变量传递到asp.net页面,急需解决方法,给50
- 通过strtotime函数得到当月第一天0点的时间为何错误?
- 403 forbidden是什么原因
- phpmyadmin问题
- 我按照http://www.chenxuanyi.cn/xampp-phpstorm-xdebug.html 这个方法。。还是不行。。。设置断点 浏览器运行lo
- 新手上路(关于mysql_fetch_array)
- 敬指点一下,关于php地址栏传递参数的问题。
- 斑竹!我的专家分怎么减少了?
<html>
<head>
<title>first program</title>
</head>
<body>
<?php
file_count();
function file_count()
{
if(!file_exists("/tmp/count.txt"))
{
exec("echo 0 > /tmp/count.txt");
}
$f_open=fopen("/tmp/count.txt","r+");
$f_size=filesize("/tmp/count.txt");
$count=fgets($f_open,$f_size+1);
$count+=1;
fseek($f_open,0);
fputs($f_open,$count);
fclose($f_open);
echo"本页已有".$count."人浏览";
return $count;
}
?>
</body>
</html>仔細比較吧