folder details?

folder details?

am 16.08.2007 03:52:47 von Bam

Is there a way to get the subfolder, and folder that a file is in, using the
filesystem or something else??

Let's say my user.asp file is user specific.

it would be located in folders as follows

user/uni/user.asp

i would need a way of finding what the subfolder the file is in, as well as
the root folder it is in.

is this possible??

--
Thanks,
Bam

Re: folder details?

am 16.08.2007 10:57:00 von exjxw.hannivoort

Bam wrote on 16 aug 2007 in microsoft.public.inetserver.asp.general:

> Is there a way to get the subfolder, and folder that a file is in,
> using the filesystem or something else??
>
> Let's say my user.asp file is user specific.
>
> it would be located in folders as follows
>
> user/uni/user.asp
>
> i would need a way of finding what the subfolder the file is in, as
> well as the root folder it is in.
>
> is this possible??

<%=Request.ServerVariables("URL")%>

<%=Request.ServerVariables("PATH_INFO")%>

<%=Request.ServerVariables("PATH_TRANSLATED")%>

<%=Request.ServerVariables("APPL_PHYSICAL_PATH")%>


--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

Re: folder details?

am 16.08.2007 13:07:33 von Bam

....
> Bam wrote on 16 aug 2007 in microsoft.public.inetserver.asp.general:
>
>> Is there a way to get the subfolder, and folder that a file is in,
>> using the filesystem or something else??
>>
>> Let's say my user.asp file is user specific.
>>
>> it would be located in folders as follows
>>
>> user/uni/user.asp
>>
>> i would need a way of finding what the subfolder the file is in, as
>> well as the root folder it is in.
>>
>> is this possible??
>
> <%=Request.ServerVariables("URL")%>
>
> <%=Request.ServerVariables("PATH_INFO")%>
>
> <%=Request.ServerVariables("PATH_TRANSLATED")%>
>
> <%=Request.ServerVariables("APPL_PHYSICAL_PATH")%>
>
>
> --
> Evertjan.
> The Netherlands.
> (Please change the x'es to dots in my emailaddress)

Thanks for the reply, but that is only part of what I need.
the path_info and URL shows the same thing. What I need IS contained in
there, but is there a way to extract it?

so I could use the info like this. Say......

Request.ServerVariables("PATH_INFO")

gives me this for example::

Bam/uni30/index.asp Now what I need is to extract out the Bam varUSER
= "Bam" and varUNI = 30

is there a way to do this??

Re: folder details?

am 16.08.2007 13:36:08 von Daniel Crichton

Bam wrote on Thu, 16 Aug 2007 07:07:33 -0400:

> ...
>> Bam wrote on 16 aug 2007 in microsoft.public.inetserver.asp.general:

>>> Is there a way to get the subfolder, and folder that a file is in,
>>> using the filesystem or something else??

>>> Let's say my user.asp file is user specific.

>>> it would be located in folders as follows

>>> user/uni/user.asp

>>> i would need a way of finding what the subfolder the file is in, as
>>> well as the root folder it is in.

>>> is this possible??

>> <%=Request.ServerVariables("URL")%>

>> <%=Request.ServerVariables("PATH_INFO")%>

>> <%=Request.ServerVariables("PATH_TRANSLATED")%>

>> <%=Request.ServerVariables("APPL_PHYSICAL_PATH")%>


>> --
>> Evertjan.
>> The Netherlands.
>> (Please change the x'es to dots in my emailaddress)

> Thanks for the reply, but that is only part of what I need.
> the path_info and URL shows the same thing. What I need IS contained in
> there, but is there a way to extract it?

> so I could use the info like this. Say......

> Request.ServerVariables("PATH_INFO")

> gives me this for example::

> Bam/uni30/index.asp Now what I need is to extract out the Bam varUSER
> = "Bam" and varUNI = 30

> is there a way to do this??

Look at the Split function

eg.

vPathComponents = Split(Request.ServerVariables("PATH_INFO"),"/")

in the case of Bam/uni30/index.asp you'll find this gives the following:

vPathComponents(0) = "Bam"
vPathComponents(1) = "uni30"
vPathComponents(2) = "index.asp"

So you can just use those array elements

varUSER = vPathComponent(0)
varUNI = vPathComponent(1)

:)

Dan

Re: folder details?

am 16.08.2007 14:01:12 von exjxw.hannivoort

Bam wrote on 16 aug 2007 in microsoft.public.inetserver.asp.general:

>> <%=Request.ServerVariables("URL")%>
>>
>> <%=Request.ServerVariables("PATH_INFO")%>
>>
>> <%=Request.ServerVariables("PATH_TRANSLATED")%>
>>
>> <%=Request.ServerVariables("APPL_PHYSICAL_PATH")%>

[please do not quote signatures. Removed]


> Thanks for the reply, but that is only part of what I need.
> the path_info and URL shows the same thing. What I need IS contained
> in there, but is there a way to extract it?
>
> so I could use the info like this. Say......
>
> Request.ServerVariables("PATH_INFO")
>
> gives me this for example::
>
> Bam/uni30/index.asp Now what I need is to extract out the Bam
> varUSER = "Bam" and varUNI = 30
>
> is there a way to do this??

Yes, thast is simple string manipulation,
and can be done, when you programme in asp-vbscript,
using instr(), left(), mid(), right(),
or, my preference, with Regex.

Or, if you like asp-jscript,
using the near equivalent functions,
or in even more consize regex.

Surely, you don't want to miss the joy of coding that yourself?

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

Re: folder details?

am 16.08.2007 17:46:36 von Bam

>> Bam wrote on 16 aug 2007 in microsoft.public.inetserver.asp.general:
>>
>>> Is there a way to get the subfolder, and folder that a file is in,
>>> using the filesystem or something else??
>>>
>>> Let's say my user.asp file is user specific.
>>>
>>> it would be located in folders as follows
>>>
>>> user/uni/user.asp
>>>
>>> i would need a way of finding what the subfolder the file is in, as
>>> well as the root folder it is in.
>>>
>>> is this possible??
>>
>> <%=Request.ServerVariables("URL")%>
>>
>> <%=Request.ServerVariables("PATH_INFO")%>
>>
>> <%=Request.ServerVariables("PATH_TRANSLATED")%>
>>
>> <%=Request.ServerVariables("APPL_PHYSICAL_PATH")%>
>>
>>
>> --
>> Evertjan.
>> The Netherlands.
>> (Please change the x'es to dots in my emailaddress)
>
> Thanks for the reply, but that is only part of what I need.
> the path_info and URL shows the same thing. What I need IS contained in
> there, but is there a way to extract it?
>
> so I could use the info like this. Say......
>
> Request.ServerVariables("PATH_INFO")
>
> gives me this for example::
>
> Bam/uni30/index.asp Now what I need is to extract out the Bam
> varUSER
> = "Bam" and varUNI = 30
>
> is there a way to do this??


Hey thanks guys. You guys rock!!

I knew there was a way, but from being so sick, my mind isn't back to normal
yet.

Bam

Re: folder details?

am 16.08.2007 17:56:48 von Bam

> Look at the Split function
>
> eg.
>
> vPathComponents = Split(Request.ServerVariables("PATH_INFO"),"/")
>
> in the case of Bam/uni30/index.asp you'll find this gives the following:
>
> vPathComponents(0) = "Bam"
> vPathComponents(1) = "uni30"
> vPathComponents(2) = "index.asp"
>
> So you can just use those array elements
>
> varUSER = vPathComponent(0)
> varUNI = vPathComponent(1)
>
> :)
>
> Dan


so my code should look like something like this?

Request.ServerVariables("PATH_INFO")
vPathComponents = Split(Request.ServerVariables("PATH_INFO"),"/")

playername = vPathComponent(0)
vuniverse = vPathComponent(1)

am i missing something?

Re: folder details?

am 16.08.2007 18:37:20 von Bam

never mind. with some tweaking i got it based on Daniel's post


thanks again to both of you!!