Im wondering if someone could help me.
I have the following URL ( which is dynamic )
www.website.com/images/gal/boxes-pic004.asp
How can i extract the 'boxes-pic004' part using classic ASP
Thanks
Im wondering if someone could help me.
I have the following URL ( which is dynamic )
www.website.com/images/gal/boxes-pic004.asp
How can i extract the 'boxes-pic004' part using classic ASP
Thanks
I think this would depend on the method you used to do the URL rewriting.
Using IIS - Refer to this previous post on how to extract the full URL: get current url of the page (used URL Rewrite)
Using 404 - This is how I've done it in the past and the only way to access the raw URL is to check the querystring. The 404 URL will look something like this:
To get the URL, I use something like this:
This will get you the full raw URL, you can then extract the part you need by using simple split like:
The strScriptName variable will then return "boxes-pic004.asp".
Hope this helps.
sScriptName
will then containboxes-pic004.asp
, then you can useReplace(sScriptName, ".asp", "")
to remove the extension as well.Simple
Just use
Request.ServerVariables("SCRIPT_NAME")
and then do some string chopping to get the stuff you need.Just you can try to output all ServerVariables like,
Eg Page Url: https://www.google.com/gmail/inbox.asp?uid=1421&skyid=2823595
Output: