qanglee 发表于 2007-4-27 10:31:39

***计数转换***来访统计

把下列代码加到网页的<body></body>标签之间 从google下载我的照片管理软件
<script language="javascript">
<!--
var caution = false
function 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 <= 4000)
                document.cookie = curcookie
      else
                if (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 null
      var cookieendindex = document.cookie.indexof(";", cookiestartindex + prefix.length)
      if (cookieendindex == -1)
                cookieendindex = document.cookie.length
      return 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 = 1
else
      visits = parseint(visits) + 1
setcookie("counter", visits, now)
document.write("阿亮欢迎您的第" + visits + "次光临!")
// -->
</script>

      










---------------- ----------------------

拥有三人行论坛管理系列软 件,一个人就可以管理一个论坛的更新维护。还能使您的 论坛有 千人在线的真实火暴效果,让您不在为 论坛因没有人气而留不住会员而烦恼,使您的论坛 早日成为一流的论坛。详情请登陆网站:http://www.cnsrx.cn 三人 行论坛管理软件, 站长必备的专业好工具。(您使用的是免费版本,购买 收费版本后,将不带广告。业务QQ:247216 449 85227)
页: [1]
查看完整版本: ***计数转换***来访统计