[quoted text, click to view] "David Taylor" wrote:
> I'm looking for a way to grab the HTML behind one of my pages and display
it
> to the user. The page I'm trying to get the HTML from is an ASP page, so
> obviously I'm looking for the post-asp processing results. Basically I
want
> the same HTML that the user could get if they had done a "View Source" in
> their browser on the page.
strURL is what you change and will display any text file. DO NOT pass
strURL as a variable because then anyone can read the source of all of your
ASP files. Also, test before you provide this to anyone. If it has a
connection to a SQL DB and had UID and PW in there, it will be displayed.
I make a separate file for each one I want to display. It is this file with
the strURL modified and I label it the same as the file with a prefix:
Ex. source_somefile.asp
<%@ Language=VBScript %>
<%
Dim strURL
strURL = "/somefolder/somefile.asp"
Dim strDir, strFileName
strDir = Request.ServerVariables("APPL_PHYSICAL_PATH")
strFileName = Replace(strURL,"/","\")
strFileName = strDir & strFileName
Const ForReading = 1
Dim objFSO, objTextStream
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
Set objTextStream = objFSO.OpenTextFile(strFileName, ForReading)
Response.Write "<HTML><BODY>"
Response.Write "<XMP>" & objTextStream.ReadAll & ""
Response.Write ""
objTextStream.Close
Set objTextStream = Nothing
Set objFSO = Nothing
%>
--
Roland
This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose.