【求助】有没有会在网页中加计数器
有没有会在网页中加计数器?我在网页里加了,但发现没有啊
可能代码位子放错了[s:11]
谁教教我啊[s:10]
[[i] 本帖最后由 唯我独尊 于 2007-9-8 11:22 编辑 [/i]] 8会做网页,在网上搜了点看看;;;
你可以用别人的[url=http://www.xcdv.com/jsq/login.asp][color=#800080]http://www.xcdv.com/jsq/login.asp[/color][/url]
也可以自己做一个,那就要使用javascript:
<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> 需要帮忙找我好了~~[s:10] [s:10] 好俄好俄
吾来行农 在什么网页中加?
博客? 一般的博客会屏蔽JAVASCRIPT的
所以二楼的方法可能不行 [s:21] 我们系的网页上加
不是博客俄 要用到数据库技术了
如果需要的话我可以帮你做一个,站内PM我就行了 这里编程高手哈多~
页:
[1]