For Programmers: Free Programming Magazines  


Home > Archive > ASP > August 2007 > folder details?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author folder details?
Bam

2007-08-15, 9:57 pm

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


Evertjan.

2007-08-16, 7:56 am

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)
Bam

2007-08-16, 7:56 am

....
> 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")%>
>
>
> --
> 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??



Daniel Crichton

2007-08-16, 7:56 am

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

> ...
[color=darkred]
[color=darkred]
[color=darkred]
[color=darkred]
[color=darkred]
[color=darkred]
[color=darkred]
[color=darkred]
[color=darkred]
[color=darkred]

[color=darkred]
[color=darkred]
> 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


Evertjan.

2007-08-16, 6:56 pm

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


[please do not quote signatures. Removed]

[color=darkred]
> 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)
Bam

2007-08-16, 6:56 pm

>> Bam wrote on 16 aug 2007 in microsoft.public.inetserver.asp.general:
>
> 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


Bam

2007-08-16, 6:56 pm

> 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?


Bam

2007-08-16, 6:56 pm

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


thanks again to both of you!!


Daburghlo0

2007-08-23, 11:41 pm

Young Natasha is used in all holes! Click the picture to watch for free!
http://shocking-p0rn-videos.info/thumb.jpg








More videos:
Amateur gay videos from Pwnzurface
Amateur gay videos from Pwnzurface
vin diesel homosexual
Links to homosexual pic
Amateur gay videos from Zaza
free gay military video
Links to here homosexual original shirt sold
Amateur gay videos from Emdegh5
Links to homosexual video
Amateur gay videos from Pune
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com