PDA

View Full Version : How many ../ from here to root?


Terabyte
07-13-2006, 03:48 PM
Hey
spose I have a file located at www.site.com/1/2/3/4.php

in order to get to a file located at www.site.com/a/b/c/d.php from 4.php i would have to go
I would have to go ../../../a/b/c/d.php right?

the question is how do i calculate the number of "../" to place in front..

so if something is in the root directory there would be no ../ involved
but if it was in a.. there would be 1 ../ needed..

How do i work out how many hops back to root are required.

Hope thats clear. Thanks.

Joe
07-13-2006, 04:39 PM
If you use just / it'll go back to the base directory. You only need to use /../ if you want to go back one or two directories.

Terabyte
07-13-2006, 06:05 PM
oh rite... i'll check that.. thanks :)

Terabyte
07-14-2006, 12:22 PM
my mistake yes it does work ^_^ Thanks

scoutt
07-14-2006, 03:20 PM
or use the full path or url.