两行代码搞定页面点击率2006-12-13

0 views
Skip to first unread message

zrq83...@gmail.com

unread,
Dec 12, 2006, 1:06:59 PM12/12/06
to 绿色精灵
两行代码搞定页面点击率
人事部来电话说她想在招聘系统的后台能看到有招聘信息的被点击率。
我记的某一文章系统有记录点击率的功能,于是拨开源码,发现还算简单
我于是学着写了如下代码
<%sqltext="select * from engage where state=1 and keyno="&keyno
rs.Open sqltext,cn,3,3
if isnull(rs("Click")) then
cn.execute("update engage Set Click=1 where state=1 and keyno="&keyno )
else
cn.execute("update engage Set Click=click+1 where state=1 and
keyno="&keyno )
end if
%>
一次就测试成功,心里的石头也落了下来 霍霍

不过这样的代码确实功能过于简单了点,
刷新一次就会自动增加一次的点击数,感觉上点虚

好象啊江的统计1.3版的也是这样的,只是现在的2.2版的多拥护版似乎改进了,一定的时间内同一ip只计算一次

Reply all
Reply to author
Forward
0 new messages