<% 'on error resume next dim fso, f, txtStream, reg, incPath set reg = new RegExp set fso = server.createObject("Scripting.FileSystemObject") if vartype(content_file) = 0 or isempty(content_file) then dim matches reg.pattern = "([a-z0-9_\-]+)" reg.ignoreCase = true if reg.test( request.serverVariables("SCRIPT_NAME") ) then set matches = reg.execute( request.serverVariables("SCRIPT_NAME") ) content_file = matches(0).value else content_file = "index" end if set matches = nothing else content_file = "index" end if %> <% if not isempty(title) then response.write title else response.write "Photographers Gallery CMS" end if %> <% incPath = server.mapPath("inc\css") &"\" if fso.fileExists(incPath & content_file &".asp") then response.write ""& vbcrlf elseif fso.fileExists(incPath & content_file &".css") then response.write ""& vbcrlf else response.write ""& vbcrlf end if %> <% incPath = server.mapPath("inc\js") &"\" if fso.fileExists(incPath & content_file &".asp") then set txtStream = fso.openTextFile(incPath &"\"& content_file &".asp") response.write txtStream.readAll() txtStream.close set txtStream = nothing elseif fso.fileExists(incPath & content_file &".js") then response.write "" end if %>