webForumDet fria alternativet

stränghantering

4 svar · 251 visningar · startad av Eclipse

EclipseMedlem sedan juli 20003 825 inlägg
#1

/xxx/xxx/xxx/trav/index.asp
/xxx/xxx/xxx/spel/index.asp
/xxx/xxx/xxx/fotboll/index.asp
/xxx/xxx/xxx/simning/index.asp
/xxx/xxx/xxx/dressyr/index.asp

Hur gör jag för att få ut namnet på mappen som indexfilen ligger i?

@ndersMedlem sedan juni 200032 969 inlägg
#2

jag hade gjort så här:

arrUrls = split(url, "/")
mappen = arrUrls(uBound(arrUrls)-1)

tror jag. :)

------------------
can i borrow your goat?

EclipseMedlem sedan juli 20003 825 inlägg
#3
myPath = request.serverVariables("path_info")
response.write myPath
myPath = split(myPath, "/")
myPath = myPath(uBound(myPath)-1)
response.write myPath

Microsoft VBScript runtime error '800a000a'

This array is fixed or temporarily locked: 'myPath'

/menu.asp, line 86

---

Öööööhhhhh....??

@ndersMedlem sedan juni 200032 969 inlägg
#4

du kan inte återanvända variabler på det sättet.

ha två olika variabler.

------------------
can i borrow your goat?

EclipseMedlem sedan juli 20003 825 inlägg
#5
myPath = request.serverVariables("path_info")
response.write myPath
myPath = split(myPath, "/")
[b]tmp[/b] = myPath(uBound(myPath)-1)
response.write [b]tmp[/b]

"Jag är dum. Jag heter Pigge Piggsvin."

120 ms totalt · 3 externa anrop · v20260731065814-full.30151723
0 ms — hämta forumlista (cache)
0 ms — hämta statistik (cache)
118 ms — hämta tråd, inlägg och bilagor (db)