trouble with include files

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

Here's my files and directories ...

On hello.php, I have the line


However, I would like the behavior to be that the included file is the
one that lives at the same level as "hello.php".  I'm noticing that the
"mirror_site/hello.php" file is including the "" top level
file when I want it to include the "mirror_site/" file.
How can I enforce this behavior?

I would prefer not to create two separate hello.php files.

Thanks for any assistance.  Using PHP 4.3 if that is useful, - Dave

Re: trouble with include files

Try to set the actual directory to a variable. Something like:

$dir = getcwd();

and then use:


Something like this would work.

Ah, by the way, don't let the extension be '.inc', put it with '.php'
in the end, if someone access your file in the browser, the browser
will display it as plain text letting everyone see your script.

Re: trouble with include files

require(dirname(__FILE__) . '/'); wrote:
Quoted text here. Click to load it

Site Timeline