asp如何防止计数器刷新计数?

时间:2009-11-22 19:19:00 

使用了application及结合数据库来保存统计数据

 

<html>
<head>
<title>asp教程-真实的计数器 aspxhome.com</title>
</head>
<body>
<%dim tms,counter,countlen
dim images(20)
h1="<p> 精彩春风计数器</font></p>"
If IsEmpty(Session("hasbeenConnected")) then
set rs=server.createobject("adodb.recordset")
application.lock
rs.open "update aspcount set countss=countss+1","dsn=userdbs",3,3
application.unlock
Session("hasbeenConnected")=True
End If
set rs=server.createobject("adodb.recordset")
rs.open "select * from aspcount","dsn=userdbs",3,3
rs.movefirst
counter=rs(0)
countlen=len(counter)
tms="<h1><font color='#8000ff'>欢迎,您是第</font>"&&counter&&"<font color='#8000ff'>位来访者!</font></h1>"
response.write(tms)
for i=1 to countlen
images(i)="<img src=" && mid(counter,i,1) && ".gif></img>"
next
response.write images(1)&&images(2)&&images(3)&&images(4)&&images(5)&&images(6)&&images(7)
rs.Close
%>
</body>
</html> 

标签:刷新,计数器,application
0
投稿

猜你喜欢

  • asp下为什么韩文字后面显示分号?

    2011-03-10 11:07:00
  • 从Web查询数据库之PHP与MySQL篇

    2009-09-19 16:58:00
  • 打败 IE 的葵花宝典:CSS Bug Table

    2010-08-03 12:30:00
  • Javascript正则表达式基础

    2009-02-01 18:13:00
  • ASP在服务器自动解压RAR文件

    2010-04-24 16:06:00
  • 简单获取键盘的KeyCode

    2008-04-18 12:37:00
  • ASP进阶学习之认识数学函数

    2007-10-08 13:15:00
  • ASP字符串大写转换成小写 ASP小写转换成大写 ucase lcase

    2011-03-31 10:59:00
  • 解决IE下提示“无法打开Internet站点 已终止操作”的错误

    2009-03-04 12:04:00
  • 网页设计中HTML常范的五个错误

    2008-04-22 18:14:00
  • MySQL数据库的自动备份与数据库被破坏后的恢复

    2010-03-18 15:30:00
  • 细化解析:Mysql数据库对文件操作的封装

    2008-11-27 16:32:00
  • asp如何在本地机器上创建缓存?

    2010-06-18 19:27:00
  • javascript判断一个元素是否数组

    2009-07-31 12:48:00
  • asp两组字符串数据比较合并相同数据

    2011-04-14 11:08:00
  • 用ASP打造一个小型的网页BBS系统

    2008-10-10 16:36:00
  • Sqlserver 2000/2005/2008 的收缩日志方法和清理日志方法

    2012-07-21 14:55:18
  • Request.ServerVariables应用实例

    2008-03-11 11:57:00
  • 分析SQL Server中数据库的快照工作原理

    2009-01-19 14:03:00
  • ASP使用连接MYSQL数据库全攻略

    2007-09-23 09:06:00
  • asp之家 网络编程 m.aspxhome.com