' %>
<%
dim nextpage'跳轉頁面
dim vipurl'推廣串連
dim JF_Rule_TimeDiff,JF_Rule_Count,JFValue_Every'間隔時間,間隔時間內的有效點擊次數,每次有效點擊 擷取的積分
dim sql'定義執行的sql語句
dim rs'定義rs
dim userid,validcount'使用者編號,時間段內的有效訪問次數
dim IP,URL '用戶端ip及i來源url
dim logincount'登入次數
dim isvalid'是否有效
dim LoginIPArea,login_Url'用戶端ip所在地區,來源url網址
login_Url=""'初始化網址
LoginIPArea=""'初始化用戶端ip地區
login_Url= Request.ServerVariables("HTTP_REFERER") '擷取用戶端ip來源地址
nextpage=""'定義跳轉的頁面
' response.write login_Url
'response.end
if len(login_Url)>0 then '來源url的處理過程
login_Url= replace(login_Url,"http://","")
login_Url= split(login_Url,"/")
login_Url= login_Url(0)
end if
isvalid=1
validcount=0
logincount=0
vipurl=request("vip")
IP = Request.ServerVariables("HTTP_X_FORWARDED_FOR") '擷取用戶端ip
If IP = "" Then IP = Request.ServerVariables("REMOTE_ADDR") 'ip地址處理
' IP=getIP()
LoginIPArea=GetIpArea(IP)
set rs=server.createobject("adodb.recordset")'建立rs對象
set rsuser=server.createobject("adodb.recordset")'建立rs對象
sql="select JF_Rule_TimeDiff,JF_Rule_Count,JFValue_Every from JF_Rule"
rs.open sql,conn,1,1
'擷取系統參數過程
if not rs.eof then
JF_Rule_TimeDiff=rs("JF_Rule_TimeDiff")'間隔時間
JF_Rule_Count=rs("JF_Rule_Count")'間隔時間內的有效點擊次數
JFValue_Every=rs("JFValue_Every")'每次有效點擊 擷取的積分
end if
rs.close
if(len(vipurl)=0) then '如果不是推廣串連進入的
'跳轉-----此處寫跳轉的頁面
response.write nextpage
response.end
else '是推廣串連 則對使用者進行有效操作
sql="select User_ID, User_Code, User_UserName, User_Login_time, User_Login_IP, User_Login_Count from C_User where User_Code='"&vipurl&"'"
rs.open sql,conn,1,1
if not rs.eof then
userid=rs("User_ID")
', User_FromUser, User_JF, User_ToUserCount,User_ToAllCount
else
'跳轉-----此處寫跳轉的頁面
response.write nextpage
response.end
end if
rs.close
end if
'---------有效點擊次數 ,下面擷取本次點擊是否有效
sql="select isnull(count(1),0) as logincount from User_GetJF where LoginIP='"&IP&"' and datediff(hour,LoginTime,cast('"&now()&"' as datetime))<="&JF_Rule_TimeDiff&""
'response.write sql
' response.end
rs.open sql,conn,1,1
if not rs.eof then
logincount=rs("logincount")'擷取有效點擊次數
end if
if(logincount>=JF_Rule_Count) then'如果點擊次數超過系統參數設定則無效
isvalid=0
end if
rs.close
sql="insert into User_GetJF(User_ID,User_GetJFValue,User_GetMethod,LoginIP,LoginIPArea,IsValid,login_Url) values("&userid&","&JFValue_Every&",'推廣訪問','"&IP&"','"&LoginIPArea&"',"&isvalid&",'"&login_Url&"') "
'寫入使用者推廣明細表
rs.open sql,conn