一个简单计数器的源代码
作者:bea
<? $memo_file="phpcount/vst.txt"; if ($phpxcount<>$REMOTE_ADDR){ $visits = file($memo_file); $number_of_last_visit = $visits[0]; $number_of_new_visit = ++$number_of_last_visit; $fp = fopen($memo_file, "w"); $fw = fwrite($fp, $numbe
<?
$memo_file="phpcount/vst.txt";
if ($phpxcount<>$REMOTE_ADDR){
$visits = file($memo_file);
$number_of_last_visit = $visits[0];
$number_of_new_visit = ++$number_of_last_visit;
$fp = fopen($memo_file, "w");
$fw = fwrite($fp, $number_of_new_visit);
fclose($fp);
$len_str = strlen($number_of_new_visit);
for($i=(0);$i<$len_str;$i++){
$numbers_exploded = substr($number_of_new_visit,$i,1);
$output_str = $output_str . "<img src="$numbers_exploded.gif">";
}
}else{
$visits = file($memo_file);
$number_of_last_visit = $visits[0];
$number_of_new_visit = $number_of_last_visit;
$fp = fopen($memo_file, "w");
$fw = fwrite($fp, $number_of_new_visit);
fclose($fp);
$len_str = strlen($number_of_new_visit);
for($i=(0);$i<$len_str;$i++){
$numbers_exploded = substr($number_of_new_visit,$i,1);
$output_str = $output_str . "<img src="$numbers_exploded.gif">";
}
}
echo $output_str;
?>
有用 |
无用
$memo_file="phpcount/vst.txt";
if ($phpxcount<>$REMOTE_ADDR){
$visits = file($memo_file);
$number_of_last_visit = $visits[0];
$number_of_new_visit = ++$number_of_last_visit;
$fp = fopen($memo_file, "w");
$fw = fwrite($fp, $number_of_new_visit);
fclose($fp);
$len_str = strlen($number_of_new_visit);
for($i=(0);$i<$len_str;$i++){
$numbers_exploded = substr($number_of_new_visit,$i,1);
$output_str = $output_str . "<img src="$numbers_exploded.gif">";
}
}else{
$visits = file($memo_file);
$number_of_last_visit = $visits[0];
$number_of_new_visit = $number_of_last_visit;
$fp = fopen($memo_file, "w");
$fw = fwrite($fp, $number_of_new_visit);
fclose($fp);
$len_str = strlen($number_of_new_visit);
for($i=(0);$i<$len_str;$i++){
$numbers_exploded = substr($number_of_new_visit,$i,1);
$output_str = $output_str . "<img src="$numbers_exploded.gif">";
}
}
echo $output_str;
?>
猜你喜欢
您可能感兴趣的文章:
- 基于mysql的论坛(4)
- 基于mysql的论坛(5)
- 基于mysql的论坛(6)
- 生成sessionid和随机密码的例子
- 基于mysql的论坛(7)
- 基于mysql的论坛(3)
- 一个简单的域名注册情况查询程序
- 不用数据库的多用户文件自由上传投票系统(2)
- PHP4实际应用经验篇(4)
- Php做的端口嗅探器--可以指定网站和端口
- PHP4实际应用经验篇(3)
- 在字符串中把网址改成超级链接
- PHP4实际应用经验篇(2)
- PHP4实际应用经验篇(1)
- 新闻分类录入、显示系统
- 如何在WIN2K下安装PHP4.04
- 通过文字传递创建的图形按钮
- 计算2000年01月01日起到指定日的天数
- 文件上传程序的全部源码