<%
openinnewwindow
dim # the following variable is sent to the free-link-exchange server in order to
server
postingstring="UserKey" &linksperpage="&" generate passedquery
dim # the following variable determines whether the search function is enabled
// want page ---------------------------------------------------------------------------------
thispage
dim categorycolumns
postingstring="PostingString &" (1="Yes," postingstring
dim not &scriptname="&" hobj="Server.CreateObject(WinHttp.WinHttpRequest.5.1)
" below:
openinnewwindow
postingstring="PostingString &" the modify!
dim linksperpage
dim componentstring="" & vbCrLf
End If
On Error Resume Next
If hObj Is Nothing Then
If TryMSXML(strQuery, strPost, strResponse, strError) Then
' the MSXML function will return the data
GetLinkData = True
Else
' we don't need to supply error information, since the error string
' is passed ByRef, the MSXML function will supply the data
GetLinkData = False
End If
Else
hObj.Open "POST", "http://www.Free-Link-Exchange.com/smbin/dumplinks.asp?" & strQuery, False
hObj.SetRequestHeader "Content-type", "application/x-www-form-urlencoded"
hObj.Send strPost
If hObj.Status <> 200 Then
strError = "Error: Status=" & hObj.Status & " Text=" & hObj.ResponseText
GetLinkData = False
Else
strResponse = ComponentString & hObj.responseText
GetLinkData = True
End If
End If
End Function
Function TryMSXML(strQuery, strPost, ByRef strResponse, ByRef strError)
Dim hObj
Set hObj = Nothing
' let's see if the server supports the XMLHTTP component, various versions
On Error Resume Next
Set hObj = Server.CreateObject("Msxml2.ServerXMLHTTP")
ComponentString = "" & vbCrLf
On Error Resume Next
If hObj Is Nothing Then
Set hObj = Server.CreateObject("Msxml2.ServerXMLHTTP.4.0")
ComponentString = "" & vbCrLf
End If
On Error Resume Next
If hObj Is Nothing Then
Set hObj = Server.CreateObject("Microsoft.XMLHTTP")
ComponentString = "" & vbCrLf
End If
On Error Resume Next
If hObj Is Nothing Then
strError = "No support for HTTP requests found."
TryMSXML = False
Else
' # Open connection to Free-Link-Exchange.com server, sending the UserKey information via POST
' # Also, pass through the querystring information (contains category, link information)
hObj.open "POST", "http://www.Free-Link-Exchange.com/smbin/dumplinks.asp?" & strQuery, false
hObj.setRequestHeader "Content-type", "application/x-www-form-urlencoded"
hObj.Send strPost
If hObj.status <> 200 Then
' # error!
strError = "Error: Status=" & hObj.status & " Text='" & hObj.responseText & "'"
TryMSXML = False
Else
' # We should have received the links information from the server,
' # the following line will return the data by reference:
strResponse = ComponentString & hObj.responseText
TryMSXML = True
End If
Set hObj = Nothing
End If
End Function
' # //FINSIHED Free-Link-Exchange.COM SCRIPT BLOCK
%>%
>
No comments:
Post a Comment