<%@ Language = VBScript %> <% Option Explicit %> <% 'James Barton 'embed_pdf.asp ' %> <% Dim pdf_document, fileName, objFSO, chkFileName pdf_document = Request.QueryString("doc") 'if document does not end in .pdf add .pdf if mid((pdf_document),(len(pdf_document)-3),4) <> ".pdf" then pdf_document = pdf_document & ".pdf" end if 'Add this code block to any asp pages that need protection '(from here to end of this asp block) ' if Session("logon_correct") <> True then ' 'Construct the URL for the current page. ' dim strURL ' strURL = "http://" ' strURL = strURL & Request.ServerVariables("HTTP_HOST") ' strURL = strURL & Request.ServerVariables("URL") ' if Request.QueryString.Count > 0 THEN ' strURL = strURL & "?" & Request.QueryString ' end if ' 'Redirect unauthorized users to the logon page. ' Response.Redirect "logon.asp?from=" &Server.URLEncode(strURL) ' End if if pdf_document <> "" then 'merge file name with path and extension fileName = "../pdfs/" & pdf_document 'this is to check for files existance 'get file location chkFileName = Server.MapPath(fileName) 'create FSO object Set objFSO = Server.CreateObject("Scripting.FileSystemObject") 'if the file doesn't exist If not objFSO.FileExists(chkFileName) then 'send missing document email not_found_Mail(pdf_document) 'load default document pdf_document = "File_Not_Found.pdf" end if end if %> <%=pdf_document%> <% 'include functions %>