當前位置:首頁 » 文件傳輸 » 訪問統計代碼
擴展閱讀
webinf下怎麼引入js 2023-08-31 21:54:13
堡壘機怎麼打開web 2023-08-31 21:54:11

訪問統計代碼

發布時間: 2022-03-06 02:15:52

⑴ 網站訪問量統計代碼

很簡單你只要進入http://www.51.la/這里注冊以後登陸.輸入自己的網站地址就會生成一段代碼直接復制粘貼到自己網站就可以了.很好用的.我用好久了.希望能對你有用!

⑵ 統計當前網頁被訪問次數的Jquery代碼:

最簡單的辦法:

<scripttype="text/javascript">

if(localStorage.pagecount){localStorage.pagecount=Number(localStorage.pagecount)+1;}else{localStorage.pagecount=1;}document.write("訪問數:"+localStorage.pagecount+"time(s).");</script>

⑶ 有統計網站訪問量的代碼嗎

假定數據存在 abc.mdb中
abc.mdb中欄位如下:
序號(自動)
日期(訪客進入時間)
電腦(IP地址)
來自(如果訪客從www.0086it.com/?f=hello 進入本站,那會顯示「hello」)
地址(通過對IP地址分析後知道的地址(如:中國網通或北京大學))

在網站首頁中插入以下代碼:
《%
if session("0086it")<>1 then
'上面一行防止刷新給統計造成不準。
dsntemp=server.mappath("abc.mdb")
set conn=server.createobject("adodb.connection")
conn.open "driver={microsoft access driver (*.mdb)};dbq="&dsntemp
set rs=server.createobject("adodb.recordset")
rs.open "db",conn,1,3
rs.addnew
rs("日期")=now()
rs("電腦")=request.servervariables("remote_addr")
rs("來自")=request.querystring("f")&"◆"&request.serverVariables("Http_REFERER")
rs("地址")=session("laizi")
'session("laizi")的值的取得不作具體介紹,是由另一程序將訪者ip地址與另外一個資料庫對比中得出來「詳細漢字地名,相當於IP地址查詢軟體中的功能)
rs.update
rs.close
set rs=nothing
conn.close
set conn=nothing
session("0086it")=1
end if
%》

這樣,每次訪客訪問我站,就可以記錄他的信息。
當然,我還需要有一個程序來讀後台。
程序如下:

《%
'**********************************
'
' 訪 客 統 計 系 統'
'
' 程序設計 : 姜川
' [email protected]
' COPY請保留以上信息
'
'*********************************
'
response.expires=0
Response.Buffer=True
dim id
id=request.querystring("id")

if id="" then
id=50
end if
%》
《html》
《style type="text/css"》
《link rel="stylesheet" href="../css/one.css" type="text/css"》
《!--
.jiangc { font-size: 9pt; line-height: 12pt}
a { color: #FF0000; text-decoration: none}
a:hover { text-decoration: underline}
--》
《/style》

《body bgcolor="#FFFFFF"》
《%
dsntemp=server.mappath("abc.mdb")
set conn=server.createobject("adodb.connection")
conn.open "driver={microsoft access driver (*.mdb)};uid=admin;password=hello;dbq="&dsntemp

if request.querystring("cha")《》"" then
sql ="select * from db where 來自 like '%"&request.form("cha")&"%' order by 日期 DESC"
else
sql ="select * from db order by 序號 DESC"
end if
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
%》
《p align="center"》《br》
《font face="黑體"》訪 問 統 計 系 統《/font》《/p》
《table width="700" border="0" cellspacing="1" cellpadding="0" align="center" class="jiangc" bgcolor="#000000"》
《form name="form1" method="post" action="?cha=1"》 《tr》
《td height="24" bgcolor="#ECF9FF" align="center"》 [ 共 《font color=red》《%=rs.recordcount%》《/font》
條記錄 ] 列出最近 《a href="?id=100"》100《/a》 《a href="?id=300"》300《/a》 《a href="?id=500"》500《/a》
《a href="?id=1000"》1000《/a》 《a href="?id=3000"》3000《/a》 《a href="?id=5000"》5000《/a》
《a href="?ID=《%=rs.recordcount%》&ID2=all"》所有《/a》 記錄
《input type="text" name="cha" class="jiangc" size="12"》
《input type="submit" name="Submit" value="查" class="jiangc"》
《/td》
《/tr》 《/form》
《/table》
《table width="100%" border="0" cellspacing="0"》
《tr》
《td height=2》《/td》
《/tr》
《/table》
《table border="0" cellspacing="1" cellpadding="2" bordercolorlight="#CCCCCC" bordercolordark="#FFFFFF" class="jiangc" align="center" bgcolor="#999999"》
《tr bgcolor="#CCCCCC"》
《td》 序號《/td》
《td》記錄中總編號《/td》
《td》訪問者進入日期《br》
0000000000000000000《/td》
《td》 訪問者電腦IP地址《/td》
《td》 地區《/td》
《td》 來自《/td》
《/tr》
《%
while not rs.eof and i《 cint(id)
i=i+1
%》
《tr bgcolor="#FFFFFF"》
《td align="center"》《font color=cccccc》《%=i%》《/font》《/td》
《td align="center"》 《%=rs("序號")%》 《/td》
《td》
《%
if rs("日期") 》 date() then
response.write "《font color=red》"&rs("日期")&"《/font》"
else
response.write rs("日期")
end if%》
《/td》
《td》
《%if rs("電腦")="221.215.99.61" then response.write "*" else response.write rs("電腦") end if%》
《/td》
《td》
《%=rs("地址")%》
《/td》
《td》
《%if instr(rs("來自"),"◆")《》0 then
response.write "《a href='"&right(rs("來自"),len(rs("來自"))-instr(rs("來自"),"◆"))&"' target='_blank'》"&rs("來自")&"《/a》"
end if%》
《/td》
《/tr》
《%
rs.movenext
wend
%》
《/table》
《br》
《table width="700" border="0" cellspacing="1" cellpadding="10" align="center" class="jiangc" bgcolor="#CCCCCC" bordercolor="#0000CC"》
《tr》
《td bgcolor="#EFEFEF"》備 註:《%if request.querystring("id2")=all then%》只列出最近的 《font color=red》《%=id%》《/font》 條記錄《br》
《%else%》
系統列出了所有訪問記錄《br》
《%end if%》
設 計:[email protected](MSN)《br》
設計日期:2003年03月《/td》
《/tr》
《/table》
《/html》

⑷ 網站訪問量統計java代碼怎樣寫

<DIV class="h">
<%-- 記錄網站訪問次數 --%>
<%
Integer counter = (Integer)application.getAttribute("counter"); //先從application裡面獲取計數器的key的值
if(counter==null){
//如果該值為null,說明第一次訪問
application.setAttribute("counter",1);
counter=(Integer)application.getAttribute("counter");
}else {
//如果該值不為空,取出來進行累加
int i = counter.intValue();
i++;
application.setAttribute("counter",i);//累加後再放進去
}
%>
<% User user =(User)session.getAttribute("users"); %>
<%="歡迎"+user.getName() %> |您是第<%=counter.intValue()%>位訪客
</DIV>
謝謝~

⑸ 網站訪問量統計java代碼

public class Counter {

private int count;

// 每訪問一次,計數器自加一
public int getCount() {
return ++count;
}

public void setCount(int count) {
this.count = count;
}

}
<%-- 定義一個 session 范圍內的計數器 記錄個人訪問信息 --%>
<jsp:useBean id="personCount" class="com.helloweenvsfei.jspweb.bean.Counter" scope="session" />

<%-- 定義一個 application 范圍內的計數器 記錄所有人的訪問信息 --%>
<jsp:useBean id="totalCount" class="com.helloweenvsfei.jspweb.bean.Counter" scope="application" />

<div align="center">
<form action="method.jsp" method="get">
<fieldset style='width: 300'>
<legend>計數器</legend>
<table align="center" width="400">
<tr>
<td width=150 align="right" style="font-weight:bold; ">您的訪問次數:</td>
<td>
<%-- 獲取個人的 訪問次數 --%>
<jsp:getProperty name="personCount" property="count" /> 次
</td>
</tr>
<tr>
<td width=150 align="right" style="font-weight:bold; ">總共的訪問次數:</td>
<td>
<%-- 獲取所有人的 訪問次數 --%>
<jsp:getProperty name="totalCount" property="count" /> 次
</td>
</tr>
</table>
</fieldset>
</form>
</div>
希望你能幫到你

⑹ 向大家求個網頁的訪問統計代碼

www.51.la
www.cnzz.com
www.1tong.com.cn
www.50bang.com
去這些站上注冊個id,然後把代碼放自己站上就行了

⑺ 求網站訪問量統計的代碼

網路搜索流量統計
第一個網站,注冊好以後,有代碼。

⑻ 求網站訪問量統計代碼

目前比較好用的有 cnzz 和 51啦 這兩個。你可以申請下試試。

⑼ html的統計訪客人數的代碼

靜態頁面的程序本身是不能調用資料庫來實現當前頁面訪問量統計的,包括實現被訪問次數、訪問次數增加等功能。但是靜態頁面如果沒有這么一個功能,卻又總覺得比動態頁面少了些什麼。
通過js後台ajax請求修改訪問數。
基於jquery:
<script>
$(function() {
$.get('update.php?id=1',{r:Math.random()});
//當然$.post()、$.ajax()等都可以咯。
//然後要記得加一個隨機數,因為如果不加的話,有的瀏覽器會認為是同一個請求,然後不請求。
});
</script>

這樣寫:

<script src="update.php?id=1"></script>

經測試,這樣也是可行的。

至於文章的id,在靜態化的過程中,可以直接賦值到頁面要請求的網址參數後。

update.php的話,就是連接資料庫,通過傳過來的文章id,更新訪問量的處理咯。

如果要實現在靜態頁面馬上顯示更新的數目的話:
方法一需要在ajax請求後調用回調函數,然後update.php返回新的訪問量,然後在回調函數中定位到顯示訪問量位置,替換成新的訪問量。
代碼實現:

$(function() {
$.get('update.php?id=1',{r:Math.random()},function(num) {
$('#hit').html(num);
});
});

方法二則需要在update.php中,添加一句話:

document.write(<?php echo $num; ?>);