日韩天天综合网_野战两个奶头被亲到高潮_亚洲日韩欧美精品综合_av女人天堂污污污_视频一区**字幕无弹窗_国产亚洲欧美小视频_国内性爱精品在线免费视频_国产一级电影在线播放_日韩欧美内地福利_亚洲一二三不卡片区

ASP實例:ASP實現(xiàn)空間的最近訪客_ASP教程

編輯Tag賺U幣
教程Tag:暫無Tag,歡迎添加,賺取U幣!

推薦:ASP防止GET,Post注入和防止服務(wù)器攻擊,并記錄IP
% '防止GET,Post注入和防止服務(wù)器攻擊 '使用方法把本文件包含到需要防注的文件就OK了,說明下,這里的post攻擊和Get攻擊不一定是攻擊,在英文版本的時候請注意使用 '馮旭修改 session.Abandon() Dim fxjt111_Attack_post,fxjt111_Attack_Get,fxjt111_Attack_Sys

由于工作關(guān)系,在做一個用戶空間。要用到空間的最近訪客,見ASP代碼:

<%
username=request.QueryString("username") '地欄中的username,就是自己的用戶名了

if trim(request.Cookies("user_name"))<>"" Then '首頁要判斷該訪問是否登陸,只有登陸的訪問才能記入數(shù)據(jù)庫。
if username <> request.Cookies("user_name") Then '判斷該訪客是否是自己
f_username=trim(request.Cookies("user_name")) '獲取訪問的用戶名
f_time=now()
Call Visitor() '調(diào)用訪問的函數(shù)
end if
end if


Sub Visitor()
'作者:無情 來源:
sqlVisitor=("select top 1 * from visitor where (username='"&username&"') and (f_username='"&f_username&"') ")
Set rsVisitor=server.CreateObject("adodb.recordset")
rsVisitor.open sqlVisitor,conn,1,1
if not (rsVisitor.eof and rsVisitor.bof) Then '判斷是否存在數(shù)據(jù)庫,如果有更新時間,沒有的話就年插入該訪客的用戶名和時間
conn.execute ("update visitor set f_time ='"&now()&"' where (username='"&username&"') and (f_username='"&f_username&"') ")
Else
conn.execute ("insert into visitor (username,f_username,f_time) values ('"&username&"','"&f_username&"','"&f_time&"')")
end If
rsVisitor.close()
Set rsVisitor=nothing
End Sub
%>

然后就是自己在空間中調(diào)用最近訪問了,代碼省略。

分享:ASP將IP地址最后一位替換成星號實例代碼
先將IP地址存入數(shù)據(jù)庫,然后取出來,效果如圖: 代碼如下: % '來源 ipstr= rs(cIP) ipstr=split(ipstr,.,-1,1) ipstrout=ipstr(0).ipstr(1).ipstr(2).* response.write ipstrout %

來源:模板無憂//所屬分類:ASP教程/更新時間:2012-06-10
相關(guān)ASP教程