Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Include a Virtual Include 1

Status
Not open for further replies.

GaryC123

Programmer
Sep 10, 2002
1,041
NO
If you've ever wanted to include a file into your page but the filename is dependant or can change subject to various factors use this code. I use for my affiliate program so I can add in a suitable header with their logos etc.

filename=varfile & ".inc"

Call DisplayFile(filename)

SUB DisplayFile(FileToRead)
filename=server.mappath(FileToRead)
Set fs = CreateObject("Scripting.FileSystemObject")
Set thisfile = fs.OpenTextFile(filename, 1, False)
tempSTR=thisfile.readall
response.write tempSTR
thisfile.Close
set thisfile=nothing
set fs=nothing
end sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top