[thelist] asp regexp/substring

Mike Hardaker mike at angloinfo.com
Fri Oct 26 09:31:48 CDT 2001


Slightly different context, but this is a code-fragment I use a lot:

<%
ThisFP = Request.ServerVariables("SCRIPT_NAME")
' -- For the filename with extension
ThisFile = Right(ThisFP, LEN(ThisFP) - InstrRev(ThisFP, "/" ))
' -- or, for the filename without, just add
ThisFile = Left(ThisFile, Instr(ThisFile, "." )-1)
%>

Remember that using HTTP_REFERER may give you something that looks like
http://thedomain.com/somefolder/ or even nothing at all...

---------------------------
Mike Hardaker
Founder & Publisher - AngloINFO
http://www.angloinfo.com


> Can anyone tell me how I get the pagename in a URI using VBScript?
>
> Example:
> strFromPage = request.servervariables("HTTP_REFERER")
> which gives
> http://thedomain.com/somefolder/thepage.asp
>





More information about the thelist mailing list