When I want to refer to a file in the main directory I have to use something like this:
$a1=function_name("/usr/www/virtual/username/www.domain.com/file.txt",9);
Since the file is in my main folder for the domain, is there a more general way to refer to the file without writing out all the "/usr/www/virtual/username/" part?
Something like this
$a1=function_name("$_Find_main_domain_path()file.txt",9);
and it would always refer to that particular file in the main directory regardless what domain it is in.
locating general file path
Moderator: General Moderators
-
jaymoore_299
- Forum Contributor
- Posts: 128
- Joined: Wed May 11, 2005 6:40 pm
- Contact:
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
unless your php is set up in an odd fashion, you can do relative path references: ../somefile.txt would refer to the parent directory's (from current working directory) file
getcwd() may be of interest.
getcwd() may be of interest.
The other interesting is the include path setting...