simple access counter
2008年08月05日 (php)
source
<html>
<head>
<title>simple access counter</title>
</head>
<body>
<?php
$f=fopen("count.txt","r+");
$count=fgets($f,10);
$count=(int)$count;
$count++;
rewind($f);
fputs($f,$count);
fclose($f);
echo("welcome to my web. you are #$count visiter.\n");
?>
</body>
</html>
command
% vim simpleaccesscounter.php % echo 0 > count.txt % chmod 666 count.txt
PR
Comment