<% Function getURL(url) On Error Resume Next Set http = Server.CreateObject("MSXML2.ServerXMLHTTP.3.0") http.open "GET", url, true http.send If http.readyState <> 4 then http.waitForResponse 10 End If If Err.Number = 0 AND http.Status = 200 then getURL=http.responsetext else getURL="" end if set http = nothing End Function 'Pass the name of the file to the function. Function getFileContents(strIncludeFile) Dim objFSO Dim objText Dim strPage 'Instantiate the FileSystemObject Object. Set objFSO = Server.CreateObject("Scripting.FileSystemObject") 'Open the file and pass it to a TextStream Object (objText). The '"MapPath" function of the Server Object is used to get the 'physical path for the file. Set objText = objFSO.OpenTextFile(Server.MapPath(strIncludeFile)) 'Read and return the contents of the file as a string. getFileContents = objText.ReadAll objText.Close Set objText = Nothing Set objFSO = Nothing End Function %> <% '------------------------------------------------------------- 'The "getFileContents" function should be included at the top 'of the ASP file. '------------------------------------------------------------- 'Declare variables to hold the content of the main page and 'the include file. Dim strMain, strInclude, fileName, fileNameNoExt 'Get the contents of the main page and pass them to the "strMain" 'variable. strMain = getFileContents("masterDesign.htm") 'Test to see if the "cboFile" select box is being submitted. If so, 'load the requested include file. If not, load the default include. 'Request.form("page") fileName = Request.QueryString("page") & ".asp" fileNameNoExt = Request.QueryString("page") strInclude = getURL("http://www.acrm.org.my/norm/registration.asp") 'After the proper include file contents are loaded ("strInclude"), 'then insert it into the main page ("strMain") using the "Replace" 'function. strMain = replace(strMain,"##PRINTER_FRIENDLY##","Printer Friendly") strMain = replace(strMain,"##INCLUDE FILE HERE##",strInclude) 'Use the "Response" Object to "Write" the completed page to the client. Response.Write strMain %>