<%@LANGUAGE="VBSCRIPT"%> <% Response.buffer = true %> <% FullPath=Request("file1") SplitPath=Split(FullPath,"\") FileName=Ubound(SplitPath) FileName=SplitPath(FileName) ExtensionSplit=Split(FileName,".") Extension=Ubound(ExtensionSplit) Extension=ExtensionSplit(Extension) %> <% 'UltraDeviant - Dynamic Include written by Owen Palmer (http://ultradeviant.co.uk) - VBScript code written by Dave Long (teq@tweekers.com) - RC Changes remove OP_txtfile = Server.MapPath(Default.asp) adn replace with OP_txtfile = FullPath Dim OP_txtfile Dim OP_fso Dim OP_incfile Dim OP_thefile OP_txtfile = FullPath 'FilePath Set OP_fso = CreateObject("Scripting.FileSystemObject") if OP_fso.FileExists(OP_txtfile) then Set OP_thefile = OP_fso.OpenTextFile(OP_txtfile,1) OP_incfile = OP_thefile.ReadAll OP_thefile.Close Set OP_fso = Nothing Set OP_thefile = Nothing else nofile.htm 'If file does not exist end if %> <%= Request("file1") %> <% If Extension = "gif" OR Extension = "jpg" then %>
<% END IF %> <% If Extension = "txt" OR Extension = "htm" OR Extension = "html" OR Extension = "shtm" OR Extension = "shtml" then %>
<%=OP_incfile%>
<% Else %>

Sorry, only GIF, JPG, TXT, HTM, HTML, SHTM, or SHTML files can be displayed

<% End If %>