Click to See Complete Forum and Search --> : how to get the lst folder name?


weee
10-10-2004, 06:21 PM
Hi there.

I want to get the last name of a folder from a URL. If I got this URL:
http://download.com/Palm-OS/2004/xp/1223/viso/

I want to get this: "viso"

I tried that:
CurrentFolder = Split(Request.ServerVariables("Script_Name"),"/")

but it didn't work out.

How can I do it?

Thanks!

chrismartz
10-10-2004, 07:02 PM
you could try request.querystring and then modify what you get!

weee
10-10-2004, 07:26 PM
querystring?

chrismartz
10-10-2004, 07:41 PM
appPath = Request.ServerVariables("URL")
Dim appPathArray = split(appPath,"/")

weee
10-10-2004, 07:46 PM
Expected end of statement

D:\WEBS\SINER6\CLIPS\../includes/menu.asp, line 2

Dim currentFolder = split(Request.ServerVariables("URL"),"/")
------------------^

My code:

Dim currentFolder = split(Request.ServerVariables("URL"),"/")

response.write currentFolder
resonse.end

chrismartz
10-10-2004, 08:02 PM
Originally posted by weee
Expected end of statement

D:\WEBS\SINER6\CLIPS\../includes/menu.asp, line 2

Dim currentFolder = split(Request.ServerVariables("URL"),"/")
------------------^

My code:

Dim currentFolder = split(Request.ServerVariables("URL"),"/")

response.write currentFolder
resonse.end try it the way i gave it....
<% Option Explicit %>
<%
Dim curFolder
curFolder=Request.ServerVariables("URL")
Dim appPathArray
appPathArray=split(CurFolder,"/")
%>
<%= curFolder %>

weee
10-10-2004, 08:08 PM
I'm getting the same error... why's that?

chrismartz
10-10-2004, 08:16 PM
<% Option Explicit %>
<%
Dim curFolder
curFolder=Request.ServerVariables("URL")
Dim appPathArray
appPathArray=split(CurFolder,"/")
%>
<%= curFolder %> I put this on my site and tried it and all works.....post your exact code and i'll look at it

weee
10-10-2004, 08:28 PM
Thanks man!

chrismartz
10-10-2004, 08:32 PM
no problem