View Full Version : grap url
The Wizzard
01-14-2003, 05:31 AM
Hey, I need to be able to grab a certain part of the url...
Lets say the page is: http://www.awesomesite.com/index.asp?ID=Blue
I want to grab just the index.asp part.
In php isnt it <? self(); ?> or something like that??
Anyways, thats what im going at
multiple options, but i usually go for something like this
do
filenamepos = InStrRev(filename, "\")
If filenamepos <> 0 then
dim removelenght, filelenght
filelenght=Len(filename)
removelenght = filelenght - filenamepos
filename = right(filename, removelenght)
end if
loop until filenamepos = 0
in your case, you could replace the \ with a ? or something
(there are a lot of other flows and controls possible, but you should get the idea (search position in string and drop everything in front (or behind) of it and loop till the string isn't found anymore)
whammy
01-15-2003, 01:11 AM
Request.ServerVariables("SCRIPT_NAME")
If it returns more than one slash (I think it might if in a subdirectory, haven't tested) you can always split it by the "/" and look for the appropriate array number. :)
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.