% '********************************************************************************************************************** 'Start write the page streaming section: DO NOT TOUCH THIS CODE '********************************************************************************************************************** PageID = Trim(Request("PageID")) if Len(PageID) > 0 then PageID = FilterIDNum(PageID) else PageID = 0 end if Action = Trim(Request("Action")) if Len(Action) > 0 then Action = FilterNonChar(Action) if Len(Action) = 0 then Action = "" else Action = "" end if PageNumber = Trim(Request("page")) if Len(PageNumber) > 0 then PageNumber = FilterIDNum(PageNumber) else PageNumber = 0 end if blnComplete = Trim(Request("blnComplete")) if Len(blnComplete) > 0 then blnComplete = True else blnComplete = False end if '==================================== ' functions '==================================== ' ----- Filters ID to strip out bad characters - used for SQL injection blocking Function FilterIDNum(IDNum) Dim objRegExp, numOutput Set objRegExp = New RegExp ' Create regular expression. objRegExp.Pattern = "[^0-9]" ' Set pattern. (numbers only) objRegExp.IgnoreCase = True ' Make case insensitive. objRegExp.Global = True ' Make Global. numOutput = objRegExp.Replace(IDNum, "") ' Remove all spaces and non-numeric characters. If (Len(numOutput) > 0 AND Len(numOutput) < 9) AND isNumeric(numOutput) Then ' Converts to integers ranging from -2,147,483,648 to 2,147,483,647 FilterIDNum = cLng(numOutput) else FilterIDNum = 0 End If Set objRegExp = Nothing End Function '==================================== ' ----- Filters Text to strip out bad characters - used for SQL injection blocking Function FilterNonChar(strToFilter) Dim objRegExp, strOutput Set objRegExp = New RegExp ' Create regular expression. objRegExp.Pattern = "[^a-zA-Z0-9\-\_\/\.\ ]" ' Set pattern. (Only allow what is shown in brackets.) objRegExp.IgnoreCase = True ' Make case insensitive. objRegExp.Global = True ' Make Global. strOutput = objRegExp.Replace(strToFilter, "") ' Remove unwanted special characters. If Len(strOutput) > 0 Then FilterNonChar = cStr(strOutput) else FilterNonChar = "" 'Used to initialize and NOT return a NULL value End If Set objRegExp = Nothing End Function '==================================== ' ----- display error Function CheckErr (ByRef msg) CheckErr = False If (Err <> 0) Then msg = "Error - " & Err.Description CheckErr = True End If End Function '==================================== Function SendXML (address, data, timeout, isPost) On Error Resume Next Dim method : method = "GET" If (isPost) Then method = "POST" Dim oXML : Set oXML = Server.CreateObject("MSXML2.ServerXMLHTTP") If (CheckErr (SendXML)) Then Exit Function oXML.setTimeouts timeout*7, timeout*7, timeout*15, timeout*15 oXML.Open method, address, False If (CheckErr (SendXML)) Then Exit Function oXML.setRequestHeader "Content-Type", "text/xml" oXML.Send data If (CheckErr (SendXML)) Then Exit Function If (oXML.status = 200) Then SendXML = oXML.responseText Else SendXML = "" End If If (CheckErr (SendXML)) Then Exit Function oXML = Nothing End Function '==================================== '==================================== ' ///////////////////////////////////////////////////////////////////////////////////// ' cDomain = trim(lcase(Replace(Request.ServerVariables("HTTP_HOST"),"local.", ""))) if left(cDomain,4)="www." then cDomain = right(cDomain,(len(cDomain)-4)) end if cParm = "?domain=" & cDomain cParm = cParm & "&agent=" & Server.URLEncode(Request.ServerVariables("HTTP_USER_AGENT")) cParm = cParm & "&referer=" & Server.URLEncode(Request.ServerVariables("HTTP_REFERER")) cParm = cParm & "&address=" & Server.URLEncode(Request.ServerVariables("REMOTE_ADDR")) cParm = cParm & "&uri=" & Server.URLEncode(Request.ServerVariables("URL")) cParm = cParm & "&query=" & Server.URLEncode(Request.ServerVariables("QUERY_STRING")) cParm = cParm & "&blnComplete=" & blnComplete & "&page=" & PageNumber cParm = cParm & "&cScript=asp" data = "" timeout = 1000 isPost = false ' ///////////////////////////////////////////////////////////////////////////////////// ' ' get the meta tags section: if PageID > 0 then 'get meta tags from articles: address = "http://www.mysearchexchange.com/ArticleMeta.asp" & cParm & "&PageID=" & PageID strTemp = (SendXML (address, data, timeout, isPost)) CountItems = 0 if Len(strTemp) > 0 then CountItems = UBound(Split(TempStr, "~")) if CountItems = 1 then strTemp = split(strTemp,"~") SiteTitle = strTemp(0) 'This var need to be inside the Title Meta Tag of header part SiteDesc = "" SiteKeyWords = "" elseif CountItems = 2 then strTemp = split(strTemp,"~") SiteTitle = strTemp(0) 'This var need to be inside the Title Meta Tag of header part SiteDesc = strTemp(1) 'This var need to be inside the Description Meta Tag of header part SiteKeyWords = "" elseif CountItems = 3 then strTemp = split(strTemp,"~") SiteTitle = strTemp(0) 'This var need to be inside the Title Meta Tag of header part SiteDesc = strTemp(1) 'This var need to be inside the Description Meta Tag of header part SiteKeyWords = strTemp(2) 'This var need to be inside the Keywords Meta Tag of header part end if end if else 'get meta tags from domain: address = "http://www.mysearchexchange.com/ArticleMeta.asp" & cParm strTemp = (SendXML (address, data, timeout, isPost)) CountItems = 0 if Len(strTemp) > 0 then CountItems = UBound(Split(TempStr, "~")) if CountItems = 1 then strTemp = split(strTemp,"~") SiteTitle = strTemp(0) 'This var need to be inside the Title Meta Tag of header part SiteDesc = "" SiteKeyWords = "" elseif CountItems = 2 then strTemp = split(strTemp,"~") SiteTitle = strTemp(0) 'This var need to be inside the Title Meta Tag of header part SiteDesc = strTemp(1) 'This var need to be inside the Description Meta Tag of header part SiteKeyWords = "" elseif CountItems = 3 then strTemp = split(strTemp,"~") SiteTitle = strTemp(0) 'This var need to be inside the Title Meta Tag of header part SiteDesc = strTemp(1) 'This var need to be inside the Description Meta Tag of header part SiteKeyWords = strTemp(2) 'This var need to be inside the Keywords Meta Tag of header part end if end if end if if PageNumber > 0 then ' we add it to title: SiteTitle = SiteTitle & " - " & PageNumber end if '********************************************************************************************************************** ' end streaming code '********************************************************************************************************************** %>