Bridging Two Worlds®

<%@ Language=VBScript %> <% Option Explicit %> Bridging Two Worlds
Bridging Two Worlds®

<% Const ForReading = 1 Dim strReferrer, objFSO, objOpenFile, strLine strReferrer = Request.QueryString("REF") If Len(strReferrer) < 1 then strReferrer = Request.ServerVariables("HTTP_REFERER") If Len(strReferrer) < 1 then Response.Write "Egad! An Error occurred! We could not" & _ " determine what page you wanted to view the source for..." Response.End Else 'With the HTTP_REFERER, the entire URL is passed along... we 'need to hack out the http://www.4guysfromrolla.com part strReferrer = Right(strReferrer,len(strReferrer)-7) strReferrer = Right(strReferrer,len(strReferrer) - _ instr(1,strReferrer,"/")+1) End If End If 'Make sure the user isn't trying to view ASP source '(You should alter this below statement to make sure that the ' reader is trying to view an article in the proper directory. ' If you do not care where the user views the articles from, ' simply remove the If statement altogether...) 'If InStr(1,UCase(strReferrer),"/WEBTECH/") = 0 OR _ ' InStr(1,strReferrer,"..") <> 0 then 'Shame on you, trying to view a page you're not suppose to... ' Response.Write "Only pages in the /webtech/" & _ ' " directory may be viewed in printer-friendly format..." ' Response.End ' End If If Len(strReferrer) < 2 then strReferrer = "/index.asp" End if Set objFSO = Server.CreateObject("Scripting.FileSystemObject") Set objOpenFile = objFSO.OpenTextFile(Server.MapPath(strReferrer), _ ForReading) 'Output each line of the file... Do Until objOpenFile.AtEndOfStream strLine = objOpenFile.ReadLine Response.Write strLine & vbCrLf Loop objOpenFile.Close Set objOpenFile = Nothing Set objFSO = Nothing %>
If you have questions or comments about this website, please send an email to webmaster@bridgingtwoworlds.net.
Copyright© 2003-2018 Bridging Two Worlds®
All Rights Reserved
If you have questions or comments about this website, please send an email to webmaster@bridgingtwoworlds.net.
Copyright© 2003-2018 Bridging Two Worlds®
All Rights Reserved