|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Parent ASPOld problem I'm considering revisiting. Say I have a bunch of "topics" and would like each to share a common code base but be accessed through their own folders. IOW, something like this: http://domain.org/subfolder/topicX/ http://domain.org/subfolder/topicY/ http://domain.org/subfolder/topicZ/ The content can all be generated from a database and some ASP code. So, what I'd really like to do is have an extremely simple index.asp in each folder that determined it's own folder name ("topicX"), and used this as a key to pass to a common code base to generates the rest of the content. Problem is, as my hazy memory recalls, calling code in a parent directory (..\code) is considered a potential security hazard, and IIS is set to prevent it. Is there a better design, that doesn't involve replicating the code in each and every subfolder? (Am I making any sense at all? <g>) Thanks... Karl Karl
You can use Request.ServerVariables("PATH_INFO ") to find out exactly where you are at from the root. --strThisPage= Request.ServerVariables("PATH_INFO ") you could then parse the returned string and use an SQL call to get the info from your db --"SELECT pgTitle, pgBody FROM dbo.Pages WHERE (pgPath = '" & strThisPage & "')" and then you can use that info to fill in your page.I would probably make this a function and use it in an include, to make the page lighterweight. I use a similiar strategy in several sites that I work with- ending up with a code working off of this logic: -virtual include getpage -virtual include header <title><%=strTitle%></title> -virtual include body <%=strBody%> -virtual include footer and getpage has the routine to read your location, get the title and the body Show quoteHide quote "Karl E. Peterson" <k***@mvps.org> wrote in message news:%236aVFPQcJHA.5412@TK2MSFTNGP04.phx.gbl... > Hi Folks -- > > Old problem I'm considering revisiting. Say I have a bunch of "topics" > and would like each to share a common code base but be accessed through > their own folders. IOW, something like this: > > http://domain.org/subfolder/topicX/ > http://domain.org/subfolder/topicY/ > http://domain.org/subfolder/topicZ/ > > The content can all be generated from a database and some ASP code. So, > what I'd really like to do is have an extremely simple index.asp in each > folder that determined it's own folder name ("topicX"), and used this as a > key to pass to a common code base to generates the rest of the content. > Problem is, as my hazy memory recalls, calling code in a parent directory > (..\code) is considered a potential security hazard, and IIS is set to > prevent it. Is there a better design, that doesn't involve replicating > the code in each and every subfolder? (Am I making any sense at all? <g>) > > Thanks... Karl > -- > .NET: It's About Trust! > http://vfred.mvps.org > Hi Mike --
Yeah, that's the general idea. The problem seems to be if I need to use a ..\code include page in there. (Working from memory here, as it's been a long time since I looked at this.) IIS in 2003/2008 is set to automatically not allow that for fear of some sort of exploit. Using your names, how do you avoid having to put getpage/header/body/footer pages in each subfolder? Thanks... Karl Mike Mueller wrote: Show quoteHide quote > You can use Request.ServerVariables("PATH_INFO ") to find out exactly where > you are at from the root. > --strThisPage= Request.ServerVariables("PATH_INFO ") > > you could then parse the returned string and use an SQL call to get the info > from your db > --"SELECT pgTitle, pgBody FROM dbo.Pages WHERE (pgPath = '" & strThisPage & > "')" > > and then you can use that info to fill in your page.I would probably make > this a function and use it in an include, to make the page lighterweight. I > use a similiar strategy in several sites that I work with- ending up with a > code working off of this logic: > > -virtual include getpage > > -virtual include header > <title><%=strTitle%></title> > -virtual include body > <%=strBody%> > -virtual include footer > and getpage has the routine to read your location, get the title and the > body > > > > > > > > "Karl E. Peterson" <k***@mvps.org> wrote in message > news:%236aVFPQcJHA.5412@TK2MSFTNGP04.phx.gbl... >> Hi Folks -- >> >> Old problem I'm considering revisiting. Say I have a bunch of "topics" >> and would like each to share a common code base but be accessed through >> their own folders. IOW, something like this: >> >> http://domain.org/subfolder/topicX/ >> http://domain.org/subfolder/topicY/ >> http://domain.org/subfolder/topicZ/ >> >> The content can all be generated from a database and some ASP code. So, >> what I'd really like to do is have an extremely simple index.asp in each >> folder that determined it's own folder name ("topicX"), and used this as a >> key to pass to a common code base to generates the rest of the content. >> Problem is, as my hazy memory recalls, calling code in a parent directory >> (..\code) is considered a potential security hazard, and IIS is set to >> prevent it. Is there a better design, that doesn't involve replicating >> the code in each and every subfolder? (Am I making any sense at all? <g>) >> >> Thanks... Karl >> -- >> .NET: It's About Trust! >> http://vfred.mvps.org <!--#include virtual="/includes/filename.ext"-->
and then I put all of the common code pages into the includes directory. Include Virtual is relative to the site root. Show quoteHide quote "Karl E. Peterson" <k***@mvps.org> wrote in message news:%23ZGzblccJHA.936@TK2MSFTNGP05.phx.gbl... > Hi Mike -- > > Yeah, that's the general idea. The problem seems to be if I need to use a > ..\code include page in there. (Working from memory here, as it's been a > long time since I looked at this.) IIS in 2003/2008 is set to > automatically not allow that for fear of some sort of exploit. Using your > names, how do you avoid having to put getpage/header/body/footer pages in > each subfolder? > > Thanks... Karl > > > Mike Mueller wrote: >> You can use Request.ServerVariables("PATH_INFO ") to find out exactly >> where >> you are at from the root. >> --strThisPage= Request.ServerVariables("PATH_INFO ") >> >> you could then parse the returned string and use an SQL call to get the >> info >> from your db >> --"SELECT pgTitle, pgBody FROM dbo.Pages WHERE (pgPath = '" & strThisPage >> & >> "')" >> >> and then you can use that info to fill in your page.I would probably make >> this a function and use it in an include, to make the page lighterweight. >> I >> use a similiar strategy in several sites that I work with- ending up with >> a >> code working off of this logic: >> >> -virtual include getpage >> >> -virtual include header >> <title><%=strTitle%></title> >> -virtual include body >> <%=strBody%> >> -virtual include footer >> and getpage has the routine to read your location, get the title and the >> body >> >> >> >> >> >> >> >> "Karl E. Peterson" <k***@mvps.org> wrote in message >> news:%236aVFPQcJHA.5412@TK2MSFTNGP04.phx.gbl... >>> Hi Folks -- >>> >>> Old problem I'm considering revisiting. Say I have a bunch of "topics" >>> and would like each to share a common code base but be accessed through >>> their own folders. IOW, something like this: >>> >>> http://domain.org/subfolder/topicX/ >>> http://domain.org/subfolder/topicY/ >>> http://domain.org/subfolder/topicZ/ >>> >>> The content can all be generated from a database and some ASP code. So, >>> what I'd really like to do is have an extremely simple index.asp in each >>> folder that determined it's own folder name ("topicX"), and used this as >>> a >>> key to pass to a common code base to generates the rest of the content. >>> Problem is, as my hazy memory recalls, calling code in a parent >>> directory >>> (..\code) is considered a potential security hazard, and IIS is set to >>> prevent it. Is there a better design, that doesn't involve replicating >>> the code in each and every subfolder? (Am I making any sense at all? >>> <g>) >>> >>> Thanks... Karl >>> -- >>> .NET: It's About Trust! >>> http://vfred.mvps.org > > -- > .NET: It's About Trust! > http://vfred.mvps.org > Mike Mueller wrote:
> <!--#include virtual="/includes/filename.ext"--> Would it be relative to the root of a subweb on a test server? (I build on a > > and then I put all of the common code pages into the includes directory. > Include Virtual is relative to the site root. subweb, and publish to a "full-blown" web.) I thought not. That something like that would still be looking at the server root. Thanks... Karl Show quoteHide quote > "Karl E. Peterson" <k***@mvps.org> wrote in message > news:%23ZGzblccJHA.936@TK2MSFTNGP05.phx.gbl... >> Hi Mike -- >> >> Yeah, that's the general idea. The problem seems to be if I need to use a >> ..\code include page in there. (Working from memory here, as it's been a >> long time since I looked at this.) IIS in 2003/2008 is set to >> automatically not allow that for fear of some sort of exploit. Using your >> names, how do you avoid having to put getpage/header/body/footer pages in >> each subfolder? >> >> Thanks... Karl >> >> >> Mike Mueller wrote: >>> You can use Request.ServerVariables("PATH_INFO ") to find out exactly >>> where >>> you are at from the root. >>> --strThisPage= Request.ServerVariables("PATH_INFO ") >>> >>> you could then parse the returned string and use an SQL call to get the >>> info >>> from your db >>> --"SELECT pgTitle, pgBody FROM dbo.Pages WHERE (pgPath = '" & strThisPage >>> & >>> "')" >>> >>> and then you can use that info to fill in your page.I would probably make >>> this a function and use it in an include, to make the page lighterweight. >>> I >>> use a similiar strategy in several sites that I work with- ending up with >>> a >>> code working off of this logic: >>> >>> -virtual include getpage >>> >>> -virtual include header >>> <title><%=strTitle%></title> >>> -virtual include body >>> <%=strBody%> >>> -virtual include footer >>> and getpage has the routine to read your location, get the title and the >>> body >>> >>> >>> >>> >>> >>> >>> >>> "Karl E. Peterson" <k***@mvps.org> wrote in message >>> news:%236aVFPQcJHA.5412@TK2MSFTNGP04.phx.gbl... >>>> Hi Folks -- >>>> >>>> Old problem I'm considering revisiting. Say I have a bunch of "topics" >>>> and would like each to share a common code base but be accessed through >>>> their own folders. IOW, something like this: >>>> >>>> http://domain.org/subfolder/topicX/ >>>> http://domain.org/subfolder/topicY/ >>>> http://domain.org/subfolder/topicZ/ >>>> >>>> The content can all be generated from a database and some ASP code. So, >>>> what I'd really like to do is have an extremely simple index.asp in each >>>> folder that determined it's own folder name ("topicX"), and used this as >>>> a >>>> key to pass to a common code base to generates the rest of the content. >>>> Problem is, as my hazy memory recalls, calling code in a parent >>>> directory >>>> (..\code) is considered a potential security hazard, and IIS is set to >>>> prevent it. Is there a better design, that doesn't involve replicating >>>> the code in each and every subfolder? (Am I making any sense at all? >>>> <g>) >>>> >>>> Thanks... Karl >>>> -- >>>> .NET: It's About Trust! >>>> http://vfred.mvps.org >> >> -- >> .NET: It's About Trust! >> http://vfred.mvps.org No
- it always relative to the main root -- Show quoteHide quote_____________________________________________ SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ] "Warning - Using the F1 Key will not break anything!" (-; _____________________________________________ "Karl E. Peterson" <k***@mvps.org> wrote in message news:%23rZXskfcJHA.1328@TK2MSFTNGP02.phx.gbl... | Mike Mueller wrote: | > <!--#include virtual="/includes/filename.ext"--> | > | > and then I put all of the common code pages into the includes directory. | > Include Virtual is relative to the site root. | | Would it be relative to the root of a subweb on a test server? (I build on a | subweb, and publish to a "full-blown" web.) I thought not. That something like | that would still be looking at the server root. | | Thanks... Karl | -- | .NET: It's About Trust! | http://vfred.mvps.org | | | | > "Karl E. Peterson" <k***@mvps.org> wrote in message | > news:%23ZGzblccJHA.936@TK2MSFTNGP05.phx.gbl... | >> Hi Mike -- | >> | >> Yeah, that's the general idea. The problem seems to be if I need to use a | >> ..\code include page in there. (Working from memory here, as it's been a | >> long time since I looked at this.) IIS in 2003/2008 is set to | >> automatically not allow that for fear of some sort of exploit. Using your | >> names, how do you avoid having to put getpage/header/body/footer pages in | >> each subfolder? | >> | >> Thanks... Karl | >> | >> | >> Mike Mueller wrote: | >>> You can use Request.ServerVariables("PATH_INFO ") to find out exactly | >>> where | >>> you are at from the root. | >>> --strThisPage= Request.ServerVariables("PATH_INFO ") | >>> | >>> you could then parse the returned string and use an SQL call to get the | >>> info | >>> from your db | >>> --"SELECT pgTitle, pgBody FROM dbo.Pages WHERE (pgPath = '" & strThisPage | >>> & | >>> "')" | >>> | >>> and then you can use that info to fill in your page.I would probably make | >>> this a function and use it in an include, to make the page lighterweight. | >>> I | >>> use a similiar strategy in several sites that I work with- ending up with | >>> a | >>> code working off of this logic: | >>> | >>> -virtual include getpage | >>> | >>> -virtual include header | >>> <title><%=strTitle%></title> | >>> -virtual include body | >>> <%=strBody%> | >>> -virtual include footer | >>> and getpage has the routine to read your location, get the title and the | >>> body | >>> | >>> | >>> | >>> | >>> | >>> | >>> | >>> "Karl E. Peterson" <k***@mvps.org> wrote in message | >>> news:%236aVFPQcJHA.5412@TK2MSFTNGP04.phx.gbl... | >>>> Hi Folks -- | >>>> | >>>> Old problem I'm considering revisiting. Say I have a bunch of "topics" | >>>> and would like each to share a common code base but be accessed through | >>>> their own folders. IOW, something like this: | >>>> | >>>> http://domain.org/subfolder/topicX/ | >>>> http://domain.org/subfolder/topicY/ | >>>> http://domain.org/subfolder/topicZ/ | >>>> | >>>> The content can all be generated from a database and some ASP code. So, | >>>> what I'd really like to do is have an extremely simple index.asp in each | >>>> folder that determined it's own folder name ("topicX"), and used this as | >>>> a | >>>> key to pass to a common code base to generates the rest of the content. | >>>> Problem is, as my hazy memory recalls, calling code in a parent | >>>> directory | >>>> (..\code) is considered a potential security hazard, and IIS is set to | >>>> prevent it. Is there a better design, that doesn't involve replicating | >>>> the code in each and every subfolder? (Am I making any sense at all? | >>>> <g>) | >>>> | >>>> Thanks... Karl | >>>> -- | >>>> .NET: It's About Trust! | >>>> http://vfred.mvps.org | >> | >> -- | >> .NET: It's About Trust! | >> http://vfred.mvps.org | | | Stefan B Rusynko wrote:
> No Yeah, that's the issue. Can't use the same code on the test subweb and deployed > - it always relative to the main root web. :-/ Show quoteHide quote > "Karl E. Peterson" <k***@mvps.org> wrote in message > news:%23rZXskfcJHA.1328@TK2MSFTNGP02.phx.gbl... >| Mike Mueller wrote: >| > <!--#include virtual="/includes/filename.ext"--> >| > >| > and then I put all of the common code pages into the includes directory. >| > Include Virtual is relative to the site root. >| >| Would it be relative to the root of a subweb on a test server? (I build on a >| subweb, and publish to a "full-blown" web.) I thought not. That something like >| that would still be looking at the server root. >| >| Thanks... Karl >| -- >| .NET: It's About Trust! >| http://vfred.mvps.org >| >| >| >| > "Karl E. Peterson" <k***@mvps.org> wrote in message >| > news:%23ZGzblccJHA.936@TK2MSFTNGP05.phx.gbl... >| >> Hi Mike -- >| >> >| >> Yeah, that's the general idea. The problem seems to be if I need to use a >| >> ..\code include page in there. (Working from memory here, as it's been a >| >> long time since I looked at this.) IIS in 2003/2008 is set to >| >> automatically not allow that for fear of some sort of exploit. Using your >| >> names, how do you avoid having to put getpage/header/body/footer pages in >| >> each subfolder? >| >> >| >> Thanks... Karl >| >> >| >> >| >> Mike Mueller wrote: >| >>> You can use Request.ServerVariables("PATH_INFO ") to find out exactly >| >>> where >| >>> you are at from the root. >| >>> --strThisPage= Request.ServerVariables("PATH_INFO ") >| >>> >| >>> you could then parse the returned string and use an SQL call to get the >| >>> info >| >>> from your db >| >>> --"SELECT pgTitle, pgBody FROM dbo.Pages WHERE (pgPath = '" & strThisPage >| >>> & >| >>> "')" >| >>> >| >>> and then you can use that info to fill in your page.I would probably make >| >>> this a function and use it in an include, to make the page lighterweight. >| >>> I >| >>> use a similiar strategy in several sites that I work with- ending up with >| >>> a >| >>> code working off of this logic: >| >>> >| >>> -virtual include getpage >| >>> >| >>> -virtual include header >| >>> <title><%=strTitle%></title> >| >>> -virtual include body >| >>> <%=strBody%> >| >>> -virtual include footer >| >>> and getpage has the routine to read your location, get the title and the >| >>> body >| >>> >| >>> >| >>> >| >>> >| >>> >| >>> >| >>> >| >>> "Karl E. Peterson" <k***@mvps.org> wrote in message >| >>> news:%236aVFPQcJHA.5412@TK2MSFTNGP04.phx.gbl... >| >>>> Hi Folks -- >| >>>> >| >>>> Old problem I'm considering revisiting. Say I have a bunch of "topics" >| >>>> and would like each to share a common code base but be accessed through >| >>>> their own folders. IOW, something like this: >| >>>> >| >>>> http://domain.org/subfolder/topicX/ >| >>>> http://domain.org/subfolder/topicY/ >| >>>> http://domain.org/subfolder/topicZ/ >| >>>> >| >>>> The content can all be generated from a database and some ASP code. So, >| >>>> what I'd really like to do is have an extremely simple index.asp in each >| >>>> folder that determined it's own folder name ("topicX"), and used this as >| >>>> a >| >>>> key to pass to a common code base to generates the rest of the content. >| >>>> Problem is, as my hazy memory recalls, calling code in a parent >| >>>> directory >| >>>> (..\code) is considered a potential security hazard, and IIS is set to >| >>>> prevent it. Is there a better design, that doesn't involve replicating >| >>>> the code in each and every subfolder? (Am I making any sense at all? >| >>>> <g>) >| >>>> >| >>>> Thanks... Karl >| >>>> -- >| >>>> .NET: It's About Trust! >| >>>> http://vfred.mvps.org >| >> >| >> -- >| >> .NET: It's About Trust! >| >> http://vfred.mvps.org Are these 2 different sites on the same server? You can set-up a server to
share folders between multiple webs. Show quoteHide quote "Karl E. Peterson" <k***@mvps.org> wrote in message news:uV13rCpcJHA.4900@TK2MSFTNGP06.phx.gbl... > Stefan B Rusynko wrote: >> No >> - it always relative to the main root > > Yeah, that's the issue. Can't use the same code on the test subweb and > deployed web. :-/ > -- > .NET: It's About Trust! > http://vfred.mvps.org > > > > >> "Karl E. Peterson" <k***@mvps.org> wrote in message >> news:%23rZXskfcJHA.1328@TK2MSFTNGP02.phx.gbl... >>| Mike Mueller wrote: >>| > <!--#include virtual="/includes/filename.ext"--> >>| > >>| > and then I put all of the common code pages into the includes >>directory. >>| > Include Virtual is relative to the site root. >>| >>| Would it be relative to the root of a subweb on a test server? (I build >>on a >>| subweb, and publish to a "full-blown" web.) I thought not. That >>something like >>| that would still be looking at the server root. >>| >>| Thanks... Karl >>| -- >>| .NET: It's About Trust! >>| http://vfred.mvps.org >>| >>| >>| >>| > "Karl E. Peterson" <k***@mvps.org> wrote in message >>| > news:%23ZGzblccJHA.936@TK2MSFTNGP05.phx.gbl... >>| >> Hi Mike -- >>| >> >>| >> Yeah, that's the general idea. The problem seems to be if I need to >>use a >>| >> ..\code include page in there. (Working from memory here, as it's >>been a >>| >> long time since I looked at this.) IIS in 2003/2008 is set to >>| >> automatically not allow that for fear of some sort of exploit. Using >>your >>| >> names, how do you avoid having to put getpage/header/body/footer >>pages in >>| >> each subfolder? >>| >> >>| >> Thanks... Karl >>| >> >>| >> >>| >> Mike Mueller wrote: >>| >>> You can use Request.ServerVariables("PATH_INFO ") to find out >>exactly >>| >>> where >>| >>> you are at from the root. >>| >>> --strThisPage= Request.ServerVariables("PATH_INFO ") >>| >>> >>| >>> you could then parse the returned string and use an SQL call to get >>the >>| >>> info >>| >>> from your db >>| >>> --"SELECT pgTitle, pgBody FROM dbo.Pages WHERE (pgPath = '" & >>strThisPage >>| >>> & >>| >>> "')" >>| >>> >>| >>> and then you can use that info to fill in your page.I would probably >>make >>| >>> this a function and use it in an include, to make the page >>lighterweight. >>| >>> I >>| >>> use a similiar strategy in several sites that I work with- ending up >>with >>| >>> a >>| >>> code working off of this logic: >>| >>> >>| >>> -virtual include getpage >>| >>> >>| >>> -virtual include header >>| >>> <title><%=strTitle%></title> >>| >>> -virtual include body >>| >>> <%=strBody%> >>| >>> -virtual include footer >>| >>> and getpage has the routine to read your location, get the title and >>the >>| >>> body >>| >>> >>| >>> >>| >>> >>| >>> >>| >>> >>| >>> >>| >>> >>| >>> "Karl E. Peterson" <k***@mvps.org> wrote in message >>| >>> news:%236aVFPQcJHA.5412@TK2MSFTNGP04.phx.gbl... >>| >>>> Hi Folks -- >>| >>>> >>| >>>> Old problem I'm considering revisiting. Say I have a bunch of >>"topics" >>| >>>> and would like each to share a common code base but be accessed >>through >>| >>>> their own folders. IOW, something like this: >>| >>>> >>| >>>> http://domain.org/subfolder/topicX/ >>| >>>> http://domain.org/subfolder/topicY/ >>| >>>> http://domain.org/subfolder/topicZ/ >>| >>>> >>| >>>> The content can all be generated from a database and some ASP code. >>So, >>| >>>> what I'd really like to do is have an extremely simple index.asp in >>each >>| >>>> folder that determined it's own folder name ("topicX"), and used >>this as >>| >>>> a >>| >>>> key to pass to a common code base to generates the rest of the >>content. >>| >>>> Problem is, as my hazy memory recalls, calling code in a parent >>| >>>> directory >>| >>>> (..\code) is considered a potential security hazard, and IIS is set >>to >>| >>>> prevent it. Is there a better design, that doesn't involve >>replicating >>| >>>> the code in each and every subfolder? (Am I making any sense at >>all? >>| >>>> <g>) >>| >>>> >>| >>>> Thanks... Karl >>| >>>> -- >>| >>>> .NET: It's About Trust! >>| >>>> http://vfred.mvps.org >>| >> >>| >> -- >>| >> .NET: It's About Trust! >>| >> http://vfred.mvps.org > > > Mike Mueller wrote:
> Are these 2 different sites on the same server? No, I have an in-house (w2k3) server that I test webs on. On there, they exist as subwebs. I suppose, I really ought to convert them over to real webs (not sure I can do that, without invoking the good graces of the IT dept?), but originally it was just IIS running on an NT4 workstation and things just sort of evolved. Just in case you want to enable Parent Pathing, follow this KB.
http://support.microsoft.com/kb/276548/) Show quoteHide quote "Karl E. Peterson" wrote: > Stefan B Rusynko wrote: > > No > > - it always relative to the main root > > Yeah, that's the issue. Can't use the same code on the test subweb and deployed > web. :-/ > -- > ..NET: It's About Trust! > http://vfred.mvps.org > > > > > > "Karl E. Peterson" <k***@mvps.org> wrote in message > > news:%23rZXskfcJHA.1328@TK2MSFTNGP02.phx.gbl... > >| Mike Mueller wrote: > >| > <!--#include virtual="/includes/filename.ext"--> > >| > > >| > and then I put all of the common code pages into the includes directory. > >| > Include Virtual is relative to the site root. > >| > >| Would it be relative to the root of a subweb on a test server? (I build on a > >| subweb, and publish to a "full-blown" web.) I thought not. That something like > >| that would still be looking at the server root. > >| > >| Thanks... Karl > >| -- > >| .NET: It's About Trust! > >| http://vfred.mvps.org > >| > >| > >| > >| > "Karl E. Peterson" <k***@mvps.org> wrote in message > >| > news:%23ZGzblccJHA.936@TK2MSFTNGP05.phx.gbl... > >| >> Hi Mike -- > >| >> > >| >> Yeah, that's the general idea. The problem seems to be if I need to use a > >| >> ..\code include page in there. (Working from memory here, as it's been a > >| >> long time since I looked at this.) IIS in 2003/2008 is set to > >| >> automatically not allow that for fear of some sort of exploit. Using your > >| >> names, how do you avoid having to put getpage/header/body/footer pages in > >| >> each subfolder? > >| >> > >| >> Thanks... Karl > >| >> > >| >> > >| >> Mike Mueller wrote: > >| >>> You can use Request.ServerVariables("PATH_INFO ") to find out exactly > >| >>> where > >| >>> you are at from the root. > >| >>> --strThisPage= Request.ServerVariables("PATH_INFO ") > >| >>> > >| >>> you could then parse the returned string and use an SQL call to get the > >| >>> info > >| >>> from your db > >| >>> --"SELECT pgTitle, pgBody FROM dbo.Pages WHERE (pgPath = '" & strThisPage > >| >>> & > >| >>> "')" > >| >>> > >| >>> and then you can use that info to fill in your page.I would probably make > >| >>> this a function and use it in an include, to make the page lighterweight. > >| >>> I > >| >>> use a similiar strategy in several sites that I work with- ending up with > >| >>> a > >| >>> code working off of this logic: > >| >>> > >| >>> -virtual include getpage > >| >>> > >| >>> -virtual include header > >| >>> <title><%=strTitle%></title> > >| >>> -virtual include body > >| >>> <%=strBody%> > >| >>> -virtual include footer > >| >>> and getpage has the routine to read your location, get the title and the > >| >>> body > >| >>> > >| >>> > >| >>> > >| >>> > >| >>> > >| >>> > >| >>> > >| >>> "Karl E. Peterson" <k***@mvps.org> wrote in message > >| >>> news:%236aVFPQcJHA.5412@TK2MSFTNGP04.phx.gbl... > >| >>>> Hi Folks -- > >| >>>> > >| >>>> Old problem I'm considering revisiting. Say I have a bunch of "topics" > >| >>>> and would like each to share a common code base but be accessed through > >| >>>> their own folders. IOW, something like this: > >| >>>> > >| >>>> http://domain.org/subfolder/topicX/ > >| >>>> http://domain.org/subfolder/topicY/ > >| >>>> http://domain.org/subfolder/topicZ/ > >| >>>> > >| >>>> The content can all be generated from a database and some ASP code. So, > >| >>>> what I'd really like to do is have an extremely simple index.asp in each > >| >>>> folder that determined it's own folder name ("topicX"), and used this as > >| >>>> a > >| >>>> key to pass to a common code base to generates the rest of the content. > >| >>>> Problem is, as my hazy memory recalls, calling code in a parent > >| >>>> directory > >| >>>> (..\code) is considered a potential security hazard, and IIS is set to > >| >>>> prevent it. Is there a better design, that doesn't involve replicating > >| >>>> the code in each and every subfolder? (Am I making any sense at all? > >| >>>> <g>) > >| >>>> > >| >>>> Thanks... Karl > >| >>>> -- > >| >>>> .NET: It's About Trust! > >| >>>> http://vfred.mvps.org > >| >> > >| >> -- > >| >> .NET: It's About Trust! > >| >> http://vfred.mvps.org > > > > Pat wrote:
> Just in case you want to enable Parent Pathing, follow this KB. Thanks. Yeah, that's the fallback. I'm told by the box owner he'd "rather I > http://support.microsoft.com/kb/276548/) didn't", so I've been looking for a more elegant design that would allow me to avoid that. I have a feeling I may end up going ahead and doing that, though.
Other interesting topics
Joining Data from multiple tables using DRW
Microsoft Expression at 50% Off Text scrolls over fixed image in IE7 & Firefox Index.html - lower case i not saving correctly Getting correct hyperlinks in a DWT Centering Website on all Monitors FTP publishing Problem with altering tab style Navigation with DWT IIS Tracking Adding WMV player |
|||||||||||||||||||||||