Original | source code | Bomb window
<%
' Author: Arisisi
' URL: http://www.alixixi.com
' Description: Welcome to use source Code program, please keep this information.
' 24 hours with 1IP only once
' Direct input to the Web site does not play
' Once you've played it, don't play it when you open another page with the Bullet window code.
' It's best to use the JS reference, so you can also use the static page
Dim Viewhistory,referer,usercookie
Dim Mydomain,reurl,oldip,oldtime
Dim Opentime,adstr
Opentime = 24 ' Set the same IP window cycle, unit: Hours
MyDomain = "alixixi.com" ' website domain name
Adstr = "<script language=" "JavaScript" "src=" "Http://alixixi.com/indexgg.js" "></script>" Ad League window code, <script>...</script> similar window code, pay attention to the single double quotes
Referer = CStr (Request.ServerVariables ("Http_referer")) ' Get access source
if (referer= "") Then ' if NULL to judge is direct access, otherwise enter through search engine or other website
Reurl=mydomain
Else
If InStr (Referer,mydomain) > 0 Then
Reurl=mydomain
Else
Reurl= "Search"
End If
End If
If Reurl = "Search" Then "if the user is through the external link to the site to determine whether more than 24 hours after the rebound window
If Trim (Request.Cookies ("IsOpen") ("user") = "then" if the user accesses the window for the first time
Call Writecookie () ' record cookie and play window operation process
Else
Usercookie = Trim (Request.Cookies ("IsOpen") ("user")
If InStr (Trim (Request.Cookies ("IsOpen") ("User"), "|") >0 Then ' If there is a cookie content to determine whether the format is correct, otherwise go to the bomb window
Oldip = Split (Usercookie, "|") (0) ' The IP record of the last pinball window in the cookie
Oldtime = Split (Usercookie, "|") (1) ' The time record of the last pinball window in the cookie
If trim (OLDIP) = Trim (Userip ()) Then ' as the last time the window IP and current IP to judge the difference
If DateDiff ("H", Oldtime,now ()) >opentime then ' if time exceeds 24 hours on the window
Call Writecookie () ' record cookie and play window operation process
Else
' Time does not exceed the window cycle does not operate
End If
Else ' New IP access bomb window
Call Writecookie () ' record cookie and play window operation process
End If
Else
Call Writecookie ()
End If
End If
End If
Sub Writecookie ()
Response.Cookies ("IsOpen"). Expires=now+1
Response.Cookies ("IsOpen") ("user") = Userip () & "|" &now ()
Response.Write "document.write (' &adstr&"); "
End Sub
Function Userip ()
Dim Getclientip
Getclientip = Request.ServerVariables ("Http_x_forwarded_for")
If Getclientip = "" or IsNull (Getclientip) or IsEmpty (Getclientip) Then
Getclientip = Request.ServerVariables ("REMOTE_ADDR")
End If
Userip = Getclientip
End Function
%>
Reference mode: <script src= "above code filename alixixi.com.asp" ></script>