登录名:  密码:  验证码: 6177
设为首页 收藏本站 联系站长
2009年1月10日
农历戊子年(鼠)
腊月十五
 首页 | 最新上传 | 新闻 | 购物商场 | 招聘求职 | HTML学习 | java学习 | IT新闻 | 黑客技术 | 域名和空间 | 流量统计 | 故事小说
 GIF动画制作 | 图片素材 | 源码下载 | 书籍下载 | 视频资料 | ASP | 数据库 | PHP | 基本电脑知识 | 迅雷资源 | 兼职 | 组网工程
 英语学习 | FLASH专区 | ASP.NET | VB | 综合资源网 | 驱动下载 | 游戏下载 | 网站模板网页美工 | 韩文学习 | 论坛
 特别推荐:产品报价  漂亮网站网址  图片素材
  我要查找:  
欢迎您来这里。每天学一点,每天进步一点!
Google
 当前位置:首页 >> ASP  >> ASP
这段ASP程序中控制同一ip限制时间点击计数怎么写?
来源:  发表日期:2008年6月9日 作者: 

 编辑:admin 级别: 司令 浏览次数:152
】    
这段程序是处理点击后给dayhits等变量计数的程序,点一次加1,但我想控制在同一IP下一定时间内不能连续点击计数,程序应该怎么写呢?

<!--#include file="conn.asp"-->
<!--#include file="function.asp"-->
<%dim lastday,tdate,p_year,p_month,p_day,period_time,rs,monthday,sql,sql1,id
        id=trim(request("id"))
        id=checkStr(id)
        if not isInteger(id) then
        response.write "您没有选择相关网站,请返回"
        response.end
        end if
        set rs=server.createobject("adodb.recordset") 
        sql="select lastday,id,monthday,url from logo where id="&id
        rs.open sql,conn,1,1
        if not (rs.eof and rs.bof) then
                  
                'response.Write(theurl)
                'response.End()
                id=rs("id")
                lastday=rs("lastday")
                monthday=rs("monthday")
                lastday=year(lastday) & "-" & month(lastday) & "-" & day(lastday)
                tdate=year(Now()) & "-" & month(Now()) & "-" & day(Now())
                        if trim(lastday)=trim(tdate) then
                        sql1="update logo set dayhits=dayhits+1 where id="&id
                        conn.Execute(sql1)
'                        response.write "success"
                        else
                        sql1="update logo set dayhits=1,lastday=now() where id="&id
                        conn.Execute(sql1)
'                        response.write "error"
                        end if
                        sql1="update logo set lasthits=lasthits+1 where id="&id
                        conn.Execute(sql1)

                           p_year=CInt(year(Now()))-CInt(year(monthday))
                           p_month=CInt(month(Now()))-CInt(month(monthday))
                           p_day=CInt(day(Now()))-CInt(day(monthday))
                           period_time=((p_year*12+p_month)*30+p_day)
                        if cint(period_time)=<cint(30) then
                        sql1="update logo set monhits=monhits+1 where id="&id
                        conn.Execute(sql1)
                        else
                        sql1="update logo set monhits=1,monthday=now() where id="&id
                        conn.Execute(sql1)
                        end if
                        response.redirect rs("url")
                end if
        rs.close
        set rs=nothing
        conn.close
        set conn=nothing%> 
(编辑:网站学习网)
 ·上一篇文章: 如何防止网站垃圾留言评论的肆略
 ·下一篇文章: Learn to Eat Li
 该篇文章的评论
 暂无相关评论
 姓名:  邮箱:
 内容:
                
 相关文章
 · Microsoft VBScript 运行
 · 整理一个asp多级树型分类
 · DW网页设计100例94:在线
 · 如何实现添加到收藏夹
 · ASP源码下载
 · ASP多媒体视频教程专区
 · MM_preloadImages()问题
 · 用ASP创建多栏选项列表S
 · 如何把ASP编写成DLL
 · Windows XP 中IIS5安装文
 · OpenSchema 方法详
 最新上传文章
 · 使用 cookie 
 · Asp Object 之
 · 建立企业信息化 &n
 · 80后IT四少:媒体塑造了我
 · 我国企业电子商务交易总
 · asp连接带有密码的acces
 · 互联网应用广泛 电
 · Adobe Illustrator
 · delphi程序打包安装制作
 · 企业邮件管理有新招&nbs
 · toolbar图标:ToolBar上的

服务说明 | 关于网站 | 联系我们 | 友情链接
网站学习网欢迎您!
http://www.studywebgood.com
浙ICP备07030755号 
联系邮箱:shuizhilang@126.com 如本网站侵犯了您的版权,请马上通知我.