the page_to_read="/abcdefg/text"& random_number &".htm
this means the folder is under the "root"
if your folder is under your "current" directory then you need to use the
dot...
the page_to_read="./abcdefg/text"& random_number &".htm
otherwise check your path...
--
Jane Alford
Software Engineer, Worldport Communications Inc
Dublin, Ireland
Quote:
> Hi Folks,
> The code below will include (at random) one of the following files into my
> web page:
> text1.htm, text2.htm, text3.htm, text4.htm or text5.htm.
> My question is - How do I go about inserting the required path for those
> files. Having to place each of the textx.htm files in the same
directories
> as each of the pages they are being included in defeats the entire
purpose,
> which was to enable me to maintain and edit one set of external files
rather
> than editing 100 different pages when ever a change needs to be made.
> Point 1: I do not want to use the command <!--#include
virtual="file.inc"-->
Quote:
> if I can help it.
> Point 2: If I simply change [the page_to_read="text"& random_number
&".htm"]
> to [the page_to_read="/abcdefg/text"& random_number &".htm] I get the
> following error:
> "Server.MapPath() error 'ASP 0174 : 80004005'"
> PLEASE HELP ME. Thanks Here is the code:
> <%
> randomize
> random_number=int(rnd*5)+1
> page_to_read="text"& random_number &".htm"
> set fso = createobject("scripting.filesystemobject")
> set act = fso.opentextfile(server.mappath(page_to_read))
> read_text = act.readall
> act.close
> response.write read_text
> %>