The line of code is:
include("./home/whatever.php")
what does the ./ mean?
I keep getting errors on that line, but it rins fine on another server. I know it isnt a code error, I found out what the problem was at a while back but I forgot.
The code ./ seems to intend to refer to the root directory of the site. The guy who made this site used it all over, it for some reason works fine on our server but it refuses to operate on my local machine.
thanks
Path to a file using include() contains a "."
Moderator: General Moderators
Re: Path to a file using include() contains a "."
. is the current working directory, so your script will look for whatever.php in a directory called "home" inside the directory it's currently running in, or in the /home directory of any directories in the include_path ( http://uk3.php.net/manual/en/ini.core.p ... clude-path ).
You can use other 'special' directories like / to get the document root, or .. to get the parent directory.
You can use other 'special' directories like / to get the document root, or .. to get the parent directory.
- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA
Re: Path to a file using include() contains a "."
Every directory you are in (except the root directory I believe) will have two special, default directories in it. Those are "." and "..".
"." is the current directory you are in.
".." is the parent directory of the directory you are in (meaning it is the directory directly above the directory you are in).
"." is the current directory you are in.
".." is the parent directory of the directory you are in (meaning it is the directory directly above the directory you are in).