解析[3] :网页计数器的原理
以下的函式是访客计数器的原型,是由 David W. Bettis 所提供,并经过作者少许修改。
<html>
<head>
<title>访客计数器 原型</title>
</head>
<body>
<?php
/*
simple access counter for php3
(c)1998 David W. Bettis
dbettis@eyeintegrated.com
medify by Wilson Peng
*/
$counterFile = "/tmp/counter.txt";
function displayCounter($counterFile) {
$fp = fopen($counterFile,"rw");
$num = fgets($fp,5);
$num += 1;
print "您是第 "."$num"." 位无聊份子";
exec( "rm -rf $counterFile");
exec( "echo $num > $counterFile");
}
if (!file_exists($counterFile)) {
exec( "echo 0 > $counterFile");
}
displayCounter($counterFile);
?>
</body>
</html>
Copyright ? 1998 David W. Bettis
<html>
<head>
<title>访客计数器 原型</title>
</head>
<body>
<?php
/*
simple access counter for php3
(c)1998 David W. Bettis
dbettis@eyeintegrated.com
medify by Wilson Peng
*/
$counterFile = "/tmp/counter.txt";
function displayCounter($counterFile) {
$fp = fopen($counterFile,"rw");
$num = fgets($fp,5);
$num += 1;
print "您是第 "."$num"." 位无聊份子";
exec( "rm -rf $counterFile");
exec( "echo $num > $counterFile");
}
if (!file_exists($counterFile)) {
exec( "echo 0 > $counterFile");
}
displayCounter($counterFile);
?>
</body>
</html>
Copyright ? 1998 David W. Bettis
中国海量技术资料网站超级搜索
本站声明
- 如果您发现链接错误,请通知我们,不胜感激。
- 如果您认为本站文章侵犯您的版权,请通知我们,我们将立即删除。
- 本站提供的文章收集连接于其他网站,版权归作者所有。
- 本站的文章仅供学习和研究之用,严禁用于商业用途。
最新统计
- 文章中心总数:51611篇
- 今日更新文章:0篇
- 本周更新文章:0篇
- 备用更新文章:10篇

