IIS ASP - Getting url from string

This is Interesting: Free IT Magazines  
Home > Archive > IIS ASP > June 2004 > Getting url from string





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 Getting url from string
Scott

2004-06-28, 7:32 pm

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.

Thanks for any input.


Steven Burn

2004-06-28, 7:32 pm

Function StripIt(sWhat)
Dim sRes
sRes = Split(sWhat, "/")
StripIt = sRes(UBound(sRes))
End Function

--

Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!


"Scott" <sbailey@mileslumber.com> wrote in message
news:eXWtVlWXEHA.3892@TK2MSFTNGP09.phx.gbl...
> 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.
>
> Thanks for any input.
>
>



Evertjan.

2004-06-29, 3:16 am

Steven Burn wrote on 29 jun 2004 in
microsoft.public.inetserver.asp.general:
> "Scott" <sbailey@mileslumber.com> wrote in message
> news:eXWtVlWXEHA.3892@TK2MSFTNGP09.phx.gbl...
> Function StripIt(sWhat)
> Dim sRes
> sRes = Split(sWhat, "/")
> StripIt = sRes(UBound(sRes))
> End Function


Or if you are a Richt()winger:

Function StripIt(sWhat)
StripIt = Right(sWhat,len(sWhat)-InstrRev(sWhat,"/"))
End Function



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






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com