10-10-2007, 03:46 PM
I'm having no luck finding this, everything I see seems far too complex for this simple operation. Can some bright spark point me in the right direction?
Here's the PHP:
$ob = file_get_contents('http://www.domain.com/page.html');
10-10-2007, 04:04 PM
Unfortunately, there isn't a truly easy way to do this in ASP. At least not that I know of.
You could use AJAX to pull the file over to the server, then use the Scripting.FileSystemObject to write the page to a string.
Complicated it is, as M$ never thought that anyone would ever want to use this feature...
10-10-2007, 05:21 PM
I might be wrong, but wouldn't this do it:
dim xmlhttp, sResult
set xmlhttp = server.Createobject("MSXML2.ServerXMLHTTP")
xmlhttp.open "GET",sURL, false
sResult = xmlhttp.ResponseText
set xmlhttp = nothing
file_get_contents = sResult
10-10-2007, 05:59 PM
Okay, thanks. And does this look right for actually using said function, as currently this just causes a redirect to the root of the domain that I put this script on...
page = file_get_contents("http://www.domain.com/page.html")