网站地图 | 购买帮助

凡人网络首页 凡人网络购物系统
网上购物系统
网上购物全站系统
网上购物系统开发 图书销售系统
网上图书销售系统
在线图书销售系统
图书销售系统开发 虚拟主机
国际域名注册
国际域名申请
网站建设 asp购物系统
凡人网络购物系统
免费网上购物系统
网上购物系统下载 网上购物系统开发
网上购物系统设计说明
网上购物系统论文
网页设计论文
网页设计毕业论文
网页设计教程 本站网页设计模板
网页设计作品展示

付款方式 | 联系方法 | 客户反馈

热门文章

ASP 编程中 20 个非常有用的例子
解决asp数据库对象只读的办法
asp滚动新闻代码
1小时asp入门,非常简单
asp日期时间星期显示
6个ASP基础问题
如何用ASP实现页面加密
ASP中使用SQL语句(总集)
轻松打造ASP计数器
统计在线人数方法详解

最新文章

不能使用 '';文件已在使用中。
Asp下Access无法更新的解决
asp滚动新闻代码
asp发送邮件代码(简单实用)
asp日期时间星期显示
解决asp数据库对象只读的办法
1小时asp入门,非常简单
ASP 编程中 20 个非常有用的例子
轻松打造ASP计数器
判断函数一览
ASP中使用Session变量的优缺点
统计在线人数方法详解
怎样做批量数据录入
ASP中使用SQL语句(总集)
Session能保留多久?
6个ASP基础问题
如何用ASP实现页面加密

轻松打造ASP计数器
轻松打造ASP计数器
作者:shnxn 网站:凡人网络
原出处http://www.ceocio.net
以下介绍用数据库实现简单计数器
'下面存为count.asp
<%
Set conn=Server.CreateObject("ADODB.Connection")
conn.Open "driver={Microsoft Access Driver (*.mdb)};dbq="& Server.MapPath("count.mdb")
%>
<%on error resume next%>
<%sql="update count set hit=hit+1%><%conn.Execute(sql)%>
<%sql = "select * from count
set rs=conn.execute(sql)
%>
<%
'更新每周每日数据
lasthit=rs("lasthit")
tdate=year(Now()) & "-" & month(Now()) & "-" & day(Now())
if trim(lasthit)=trim(tdate) then
sql="update site set dayhit=dayhit+1 where id="&request("id")
conn.Execute(sql)
' response.write "success"
else
sql="update site set dayhit=1 where id="&request("id")
conn.Execute(sql)
' response.write "error"
end if
sql="update site set lasthit='"&tdate&"' where ID="&request("id")
conn.Execute(sql)

p_year=CInt(year(Now()))-CInt(year(lasthit))
p_month=CInt(month(Now()))-CInt(month(lasthit))
p_day=CInt(day(Now()))-CInt(day(lasthit))
period_time=((p_year*12+p_month)*30+p_day)
if cint(period_time)=<cint(7) then
sql="update site set weekhit=weekhit+1 where id="&request("id")
conn.Execute(sql)
else
sql="update site set weekhit=1 where id="&request("id")
conn.Execute(sql)
end if
%>
document.write('<tr><td width="100%">今日访问<%=rs("dayhit")%>次,本周访问<%=rs("weekhit")%>次,总访问<%=rs("hit")%>次</td></tr>');
<%rs.close
set rs=nothing%>


'用<script language="JavaScript1.1" src="count.asp"></script>在要统计的页面调用即可.

建立数据库:建一个count的MDB库,再建一个表count,表中字段为
hit 数字型
dayhit 数字型
weekhit 数字型
lasthit 日期型
转载请注明出自:凡人网络VenShop.Com
发现内容有误 / 侵犯您的版权

↑相关文章:
不能使用 '';文件已在使用中。
Asp下Access无法更新的解决
asp滚动新闻代码
asp发送邮件代码(简单实用)
asp日期时间星期显示
解决asp数据库对象只读的办法
1小时asp入门,非常简单
ASP 编程中 20 个非常有用的例子
轻松打造ASP计数器
判断函数一览
ASP中使用Session变量的优缺点
统计在线人数方法详解
怎样做批量数据录入
ASP中使用SQL语句(总集)
Session能保留多久?
6个ASP基础问题
如何用ASP实现页面加密


关于我们 | 汇款方式 | 建站流程 | 联系方法 | 常见问题 | 新闻公告 | 加入收藏 | 留言本站

客服热线:(010)83616015-201/202,(010)80928177 邮箱:Venshop@163.com
®北京凡人高科技术有限公司版权所有 Powered By :Beijing vGoq Technology Co.,Ltd.
软件著作权证书登记号:2006SRBJ0621   软著登字第BJ4429号
企业法人营业执照注册号:1101082924320 北京市高新技术企业 高新认证编号:0611008A14487
京ICP备05061904号 Copyright © 2002-2008 VENSHOP.COM. All Rights Reserved.