当前位置: 首页 > 图文教程 > 网络编程 > 编程10000问 > 如何实现点击数的计算?

编程10000问
如何实现点击数的计算?
如何随机显示图片计数器?
如何用数据库制作一个多用户版的计数器?
如何制作一个防止多次刷新计数的图片计数器?
如何做一个计数器并让人家申请使用?
统计在线人数是实时的吗?
图像图表
如何把图片也存到数据库中去?
如何使图象随机显示?
如何制作K线图?
为什么有的留言簿不需要数据库?
如何编写一个最简单的聊天程序?
如何判断发言是否为空?
如何判断用户是否非正常离开聊天室?
如何用变量实现群聊和悄悄话?
如何判断电子邮件的地址格式是否正确?
如何实现电子邮件的自动发送?
如何使用表单发送电子邮件?
如何用ASP发送html格式的邮件?
如何用ASP发送带附件的邮件?

编程10000问 中的 如何实现点击数的计算?


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2010-01-10   浏览: 28 ::
收藏到网摘: n/a

counter.htm

a href=counter.asp?save=123&url=http://127.0.0.1/http://127.0.0.1/a
共点击次数:<script src=view.asp?save=123></script
counter.asp
%
path="d:data"
file=request("save")
url=request("url")
Set fs = CreateObject("Scripting.FileSystemObject")
if fs.FileExists(path & file & ".txt") then
Set thisfile = fs.OpenTextFile(path & file & ".txt", 1, False)
number=thisfile.readline + 1
thisfile.Close
Set outfile=fs.CreateTextFile(path & file & ".txt")
outfile.WriteLine number
outfile.close
set fs=nothing
else
number=1
Set outfile=fs.CreateTextFile(path & file & ".txt")
outfile.WriteLine number
outfile.close
set fs=nothing


end if
response.redirect url
%

view.asp
%
path="d:data"
file=request("save")
Set fs = CreateObject("Scripting.FileSystemObject")
if fs.FileExists(path & file & ".txt") then
Set thisfile = fs.OpenTextFile(path & file & ".txt", 1, False)
number=thisfile.readline
thisfile.Close
set fs=nothing
else
number=0
end if
response.contenttype = "application/x-javascript"
response.write "document.write(""" & number & """);"
%

[1]