Getting URL from string

S

Scott

If Request.ServerVariables("URL") renders

/myserver/mywebpage.asp

How can I just return mywebpage.asp?

I can use the RIGHT function, but I'd like for it to work on any page,
regardless of the length of the page name. I'm looking for a good example of
using a combination of MID, LEFT, RIGHT, etc to get certain parts of
strings.

Thanks for any input.
 
D

dlbjr

Response.Write GetPageString("/myserver/mywebpage.asp")

Function GetPageString(str1)
If Len(str1) > 0 Then
str1 = StrReverse(str1)
intStop = InStr(1,str1,"/") - 1
If intStop > 0 Then
GetPageString = StrReverse(Left(str1,intStop))
End If
End If
End Function

'dlbjr
'Pleading sagacious indoctrination!
 
S

Scott

sorry about double post, i couldn't see my first post until i refreshed and
had already re-submitted. thank you.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,156
Messages
2,570,878
Members
47,413
Latest member
KeiraLight

Latest Threads

Top