Forums
This topic is locked
Help with "Dynamic Include" extension
Posted 12 Jul 2001 20:52:12
1
has voted
12 Jul 2001 20:52:12 Adam Cronin posted:
Hi,Ive just started playing about with the "Dynamic include" extension off macromedias site, and it all seems to work fine, until I try using it twice on the same page. At the moment its displaying a text file, but theres another three that I want to display on the page - but whenever i add another dynamic include on the page, it throws up errors in the browser.
Is there some sort of "rule" saying that anything to do with FileSystemObject is limited to be used once per page ?
Looking at the code, I can see whats happening, it calls the text file at the top of the page :
-<%
'UltraDeviant - Dynamic Include written by Owen Palmer (ultradeviant.co.uk) - VBScript code written by Dave Long ( )
Dim OP_txtfile
Dim OP_fso
Dim OP_incfile
Dim OP_thefile
OP_txtfile = Server.MapPath("Arcom/bfreeze.txt" '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
OP_incfile = "No current data" 'If file does not exist
end if
%>-
And then to display it, it later says "<%=OP_incfile%>" to bring up the text. Trying to add another text file just writes exactly the same code after this ^^ - so obviously their conflicting somehow.
Anyone got any ideas ?