Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Set variable to contents of a webpage

Status
Not open for further replies.

Scorez2000

Programmer
Feb 5, 2004
87
GB
This is following on from a post I made yesterday. I've only solved half the problem.

All I need to do now, is get the contents of a file on te internet into a variable in my ASP page on my server.

The web page on the internet is:
So if, somehoe, I could get a variable set as the text string on that page, all my troubles would be gone.

myVariable = "the string held in the address up there"

All help appreciated.
Wayne.
 
using the FSO you could do the following, but only if the file is on your server

Code:
Set objFSO = CreateObject("Scripting.FileSystemObject")

Set a = objFSO.OpenTextFile(Server.MapPath("\jobs\jobsdumper.php3"))
mystring=a.readAll 

Set a = Nothing  
Set objFSO = Nothing
the file contents are now held in mystring

}...the bane of my life!
 
If the file is not on your server you can use the server-safe version of the xmlhttp object to get the output of that page... it wont get the PHP source but rather the output as sent to a browser.
 
Sheco, the file is not, as you say, on my server.

Can you tell me more about this xmlhttp, or link to me to some simple user guides on how to do what I want?

Thanks.

Wayne.
 
Do a google search for AJAX

Tracy Dryden

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard. [dragon]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top