Staredit Network

Staredit Network -> Computers and Technical -> PHP Problem
Report, edit, etc...Posted by Centreri on 2006-04-26 at 15:23:51
I'm working on a small CMS system, and (embarrassingly) the problem right now is:
How do I make it so I can access a file in the main script directory from a directory within the main script directory file.

In effect:
To access a file in a directory within the current directory, you just write something like
CODE
<a href="directory/whatever.php">
, and you don't have to write out anything before that, no matter where the file is. No C:/Program Files/whatever. How do you do that in reverse? From a subdirectory into a directory?
Report, edit, etc...Posted by IanMM on 2006-04-26 at 16:05:46
Can we have a link to the file?

I use this it works for me but make sure to put a slash in front:

CODE
<a href="/directory/file.php">
Report, edit, etc...Posted by @:@ on 2006-04-26 at 16:34:01
Pretty sure if you put a ".../file.php" the path starts from the root.
Report, edit, etc...Posted by Centreri on 2006-04-26 at 16:35:50
Oh, ok, thanks. From the root of what, though? I need it from the root of the script, or something similar from which it can navigate without problems.
Report, edit, etc...Posted by Shmeeps on 2006-04-26 at 18:02:53
Root of the script, use '../file.php';

Every ../ raises the directory onelevel.
Report, edit, etc...Posted by Centreri on 2006-04-26 at 18:26:24
So ..../ would be two directories back and ....../ would be 3 directories back?
Report, edit, etc...Posted by Doodle77(MM) on 2006-04-26 at 18:43:26
no, ../../ would be two and ../../../ would be 3.
Report, edit, etc...Posted by Centreri on 2006-04-26 at 18:49:37
Ok, thank you happy.gif.

-Locked
Next Page (1)