wordpress中怎么实现网站统计
var caution = falsefunction setCookie(name, value, expires, path, domain, secure) {var curCookie = name + "=" + escape(value) +((expires) ? "; expires=" + expires.toGMTString() : "") +((path) ? "; path=" + path : "") +((domain) ? "; domain=" + domain : "") +((secure) ? "; secure" : "")if (!caution || (name + "=" + escape(value)).length document.cookie = curCookieelseif (confirm("Cookie exceeds 4KB and will be cut!"))document.cookie = curCookie}function getCookie(name) {var prefix = name + "="var cookieStartIndex = document.cookie.indexOf(prefix)if (cookieStartIndex == -1)return nullvar cookieEndIndex = document.cookie.indexOf(";", cookieStartIndex + prefix.length)if (cookieEndIndex == -1)cookieEndIndex = document.cookie.lengthreturn unescape(document.cookie.substring(cookieStartIndex + prefix.length, cookieEndIndex))}function deleteCookie(name, path, domain) {if (getCookie(name)) {document.cookie = name + "=" + ((path) ? "; path=" + path : "") +((domain) ? "; domain=" + domain : "") +"; expires=Thu, 01-Jan-70 00:00:01 GMT"}}function fixDate(date) {var base = new Date(0)var skew = base.getTime()if (skew >0)date.setTime(date.getTime() - skew)}var now = new Date()fixDate(now)now.setTime(now.getTime() + 365 * 24 * 60 * 60 * 1000)var visits = getCookie("counter")if (!visits)visits = 1elsevisits = parseInt(visits) + 1setCookie("counter", visits, now)document.write("您是第 " + visits + " 个来到本站访客")// --></script>写进你的网页就OK了!!
不用后台数据库可不可以统计网站日访问量?asp代码怎么写?
可以啊 ,用文本就可以啊,代码如下:======================gh027soft====================================dim count Set fs=CreateObject("scripting.filesystemobject") Set hs=fs.opentextfile(server.Mappath("count.txt")) count=hs.readline if session("iscount")="" then session("iscount")="iscount" count=count+1 end if response.write "您是第" & count &; "位访问者!" Set hs=fs.createtextfile(server.Mappath("count.txt")) hs.writeline(count) hs.close set fs=nothing %> =================gh027soft======================================count.txt 就是计数的文件谢谢!
转载请注明出处51数据库 » wordpress 访问量统计
柯以敏他爹