|
-
Mar 9th, 2007, 03:18 AM
#1
Thread Starter
Addicted Member
Including data from another server?
I have an ASP page running on server A
I want to embed outout from an asp file on server B
I don't mind if it is importing the rendered output or calling a function within the remote file.
Is this possible?
Does the thread even make sense?
Don't even think about suggesting an inline frame as the script on server A will not actually be displaying a webpage to the browser...
Another light-hearted post from Guru 
-
Mar 9th, 2007, 06:00 AM
#2
Thread Starter
Addicted Member
Re: Including data from another server?
OK. I've discovered I can include and Internet Transfer Control within the asp.
Not the fastest solution but it works.
Any more ideas?
Another light-hearted post from Guru 
-
Mar 9th, 2007, 01:48 PM
#3
PowerPoster
Re: Including data from another server?
Sure, MSXML ..
Code:
'// example usage
Dim sText
sText = GetHttp("http://www.mywebsiteurl.com/default.asp?this=that")
If Len(sText) Then
Response.Write GetText(sText, "mystarttag", "myendtag")
End If
'// get data from website
Function GetHttp(ByVal pURL)
Dim objHttp
On Error Resume Next
Set objHttp = CreateObject("Microsoft.XMLHTTP")
objHttp.Open "GET", pURL, False
objHttp.Send ""
GetHttp = objHttp.ResponseText
Set objHttp = Nothing
End Function
'// get specific text from data
Function GetText(ByVal pText, ByVal pStart, ByVal pEnd)
Dim iStart, iEnd, sTemp
On Error Resume Next
iStart = InStr(1, pText, pStart, vbTextCompare)
If iStart > 0 Then
iEnd = InStr(iStart, pText, pEnd, vbTextCompare)
If iEnd > 0 Then
sTemp = Mid(pText, iStart, iEnd-iStart)
GetText = Trim(sTemp)
End If
End If
End Function
Last edited by rory; Mar 9th, 2007 at 01:57 PM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|